public function DrupalOAuthDataStore::lookup_consumer in OAuth 1.0 7.3
Same name and namespace in other branches
- 6.3 includes/DrupalOAuthDataStore.inc \DrupalOAuthDataStore::lookup_consumer()
- 6 oauth.module \DrupalOAuthDataStore::lookup_consumer()
- 7.4 includes/DrupalOAuthDataStore.inc \DrupalOAuthDataStore::lookup_consumer()
Check if consumer exists from a given consumer key.
Parameters
string $consumer_key: The consumer key.
bool $provider_consumer: Whether the consumer should be a provider consumer
Return value
OAuthConsumer The consumer
Throws
OAuthException An exception is thrown when the consumer cannot be found
Overrides OAuthDataStore::lookup_consumer
File
- includes/
DrupalOAuthDataStore.inc, line 25
Class
- DrupalOAuthDataStore
- Database abstraction class
Code
public function lookup_consumer($consumer_key, $provider_consumer = TRUE) {
$consumer = DrupalOAuthConsumer::loadProviderByKey($consumer_key);
if (!$consumer) {
throw new OAuthException('Consumer not found');
}
return $consumer;
}