You are here

function twitter_account_delete in Twitter 7.6

Same name and namespace in other branches
  1. 6.5 twitter.inc \twitter_account_delete()
  2. 7.3 twitter.inc \twitter_account_delete()
  3. 7.4 twitter.inc \twitter_account_delete()
  4. 7.5 twitter.inc \twitter_account_delete()

Delete a twitter account and its statuses.

Parameters

$twitter_uid: An integer with the Twitter UID.

1 call to twitter_account_delete()
twitter_account_list_form_submit in ./twitter.pages.inc
Form submit handler for altering the list of Twitter accounts.

File

./twitter.inc, line 390

Code

function twitter_account_delete($twitter_uid) {
  $account = entity_load_single('twitter_account', $twitter_uid);

  // Delete from {twitter_account}.
  entity_delete('twitter_account', $twitter_uid);

  // Delete from {twitter}.
  $twitter_statuses = twitter_tweets($account->screen_name);
  entity_delete_multiple('twitter_status', array_keys($twitter_statuses));

  // Delete from {authmap}.
  $query = db_delete('authmap');
  $query
    ->condition('authname', $twitter_uid);
  $query
    ->condition('module', 'twitter');
  $query
    ->execute();
}