function twitter_account_load in Twitter 7.6
Same name and namespace in other branches
- 6.5 twitter.inc \twitter_account_load()
- 6.3 twitter.inc \twitter_account_load()
- 6.4 twitter.inc \twitter_account_load()
- 7.3 twitter.inc \twitter_account_load()
- 7.4 twitter.inc \twitter_account_load()
- 7.5 twitter.inc \twitter_account_load()
Loads a Twitter account by its screen_name.
Parameters
string $screen_name: A Twitter account name.
Return value
A TwitterAccount object or FALSE.
3 calls to twitter_account_load()
- twitter_last_tweet_field_field_formatter_view in twitter_last_tweet_field/
twitter_last_tweet_field.module - Implements hook_field_formatter_view().
- twitter_non_auth_account_form_validate in ./
twitter.pages.inc - Form validation for adding a new non-authenticated Twitter account.
- _twitter_actions_get_twitter_id in twitter_actions/
twitter_actions.module - Validates the Twitter account to use to send a Tweet.
File
- ./
twitter.inc, line 64
Code
function twitter_account_load($screen_name) {
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'twitter_account')
->propertyCondition('screen_name', $screen_name);
$result = $query
->execute();
$ids = !empty($result['twitter_account']) ? array_keys($result['twitter_account']) : array();
if (count($ids)) {
return entity_load_single('twitter_account', array_pop($ids));
}
else {
return FALSE;
}
}