public function OAuthStorePostgreSQL::countConsumerAccessTokens in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
- 7.2 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
- 7.3 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
- 7.5 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
- 7.6 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
Count the consumer access tokens for the given consumer.
Parameters
string consumer_key:
Return value
int
Overrides OAuthStoreAbstract::countConsumerAccessTokens
File
- lib/
oauth-php/ library/ store/ OAuthStorePostgreSQL.php, line 1322
Class
Code
public function countConsumerAccessTokens($consumer_key) {
$count = $this
->query_one('
SELECT COUNT(ost_id)
FROM oauth_server_token
JOIN oauth_server_registry
ON ost_osr_id_ref = osr_id
WHERE ost_token_type = \'access\'
AND osr_consumer_key = \'%s\'
AND ost_token_ttl >= NOW()
', $consumer_key);
return $count;
}