You are here

public static function DrupalOAuthConsumer::deleteConsumer in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 includes/DrupalOAuthConsumer.inc \DrupalOAuthConsumer::deleteConsumer()
  2. 7.4 includes/DrupalOAuthConsumer.inc \DrupalOAuthConsumer::deleteConsumer()

Deletes the consumer with the id from the database.

Parameters

string $csid: The consumer id.

Return value

void

1 call to DrupalOAuthConsumer::deleteConsumer()
DrupalOAuthConsumer::delete in includes/DrupalOAuthConsumer.inc
Deletes the consumer from the database

File

includes/DrupalOAuthConsumer.inc, line 121

Class

DrupalOAuthConsumer

Code

public static function deleteConsumer($csid) {

  //TODO: Add compatibility layer?
  $condition = db_and()
    ->condition('csid', $csid);
  db_delete('oauth_common_provider_token')
    ->condition('tid', db_select('oauth_common_token', 't')
    ->condition($condition)
    ->fields('t', array(
    'tid',
  )), 'IN')
    ->execute();
  foreach (array(
    'oauth_common_token',
    'oauth_common_provider_consumer',
    'oauth_common_consumer',
  ) as $table) {
    db_delete($table)
      ->condition($condition)
      ->execute();
  }
}