You are here

function twitter_account_delete in Twitter 7.5

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

Delete a twitter account and its statuses.

Parameters

$twitter_uid: An integer with the Twitter UID.

2 calls to twitter_account_delete()
twitter_account_list_form_submit in ./twitter.pages.inc
Form submit handler for altering the list of Twitter accounts.
twitter_user_delete in ./twitter.module
Implements hook_user_delete().

File

./twitter.inc, line 441

Code

function twitter_account_delete($twitter_uid) {
  $twitter_account = twitter_account_load($twitter_uid);

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

  // Delete from {twitter}.
  $query = db_delete('twitter');
  $query
    ->condition('screen_name', $twitter_account->screen_name);
  $query
    ->execute();

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