public static function DrupalOAuthConsumer::loadProviderByKey in OAuth 1.0 7.3
Same name and namespace in other branches
- 6.3 includes/DrupalOAuthConsumer.inc \DrupalOAuthConsumer::loadProviderByKey()
- 7.4 includes/DrupalOAuthConsumer.inc \DrupalOAuthConsumer::loadProviderByKey()
Gets a provider consumer with the specified key
Parameters
string $key: The key of the consumer to get
boolean $provider: Used internally for backwards compatibility with ::load()
Return value
DrupalOAuthConsumer The loaded consumer object or FALSE if load failed
4 calls to DrupalOAuthConsumer::loadProviderByKey()
- DrupalOAuthConsumer::load in includes/
DrupalOAuthConsumer.inc - Deprecated - Gets the consumer with the specified key
- DrupalOAuthDataStore::lookup_consumer in includes/
DrupalOAuthDataStore.inc - Check if consumer exists from a given consumer key.
- oauth_common_context_from_request in ./
oauth_common.module - Loads the context for a request.
- oauth_common_verify_request in ./
oauth_common.inc - Verifies the request
File
- includes/
DrupalOAuthConsumer.inc, line 191
Class
Code
public static function loadProviderByKey($key, $provider = TRUE) {
$query = db_select('oauth_common_consumer', 'c');
$query
->condition('c.key_hash', sha1($key))
->fields('c', array(
'secret',
'configuration',
));
if ($provider) {
$query
->join('oauth_common_provider_consumer', 'pc', 'pc.csid = c.csid');
$query
->fields('pc');
}
else {
// For backwards compatibility with deprecated DrupalOAuthConsumer::load() from 6.x-3.0-beta3
$query
->leftJoin('oauth_common_provider_consumer', 'pc', 'pc.csid = c.csid');
$query
->fields('c', array(
'csid',
'consumer_key',
))
->fields('pc', array(
'created',
'changed',
'uid',
'name',
'context',
'callback_url',
))
->isNull('pc.csid');
}
return self::fromResult($query
->execute());
}