You are here

public function TwitterAccount::__construct in Twitter 7.6

Constructor

Overrides Entity::__construct

File

./twitter.module, line 738
Provides API integration with the Twitter microblogging service.

Class

TwitterAccount
Class to define the structure of a Twitter account.

Code

public function __construct($values = array()) {

  // Prepare values to match twitter_account table fields.
  if (!empty($values['id'])) {
    $values['twitter_uid'] = $values['id'];
    unset($values['id']);
  }
  if (!empty($values['created_at']) && ($created_time = strtotime($values['created_at']))) {
    $values['created_time'] = $created_time;
  }
  $values['utc_offset'] = isset($values['utc_offset']) ? $values['utc_offset'] : 0;
  if (isset($values['status'])) {
    $this->status = new TwitterStatus($values['status']);
    unset($values['status']);
  }
  parent::__construct($values, 'twitter_account');
}