public function OAuthStoreSQL::countServerTokens in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countServerTokens()
- 7.2 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countServerTokens()
- 7.3 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countServerTokens()
- 7.5 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countServerTokens()
- 7.6 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countServerTokens()
* Count how many tokens we have for the given server * *
Parameters
string consumer_key: * @return int
Overrides OAuthStoreAbstract::countServerTokens
File
- lib/
oauth-php/ library/ store/ OAuthStoreSQL.php, line 561
Class
Code
public function countServerTokens($consumer_key) {
$count = $this
->query_one('
SELECT COUNT(oct_id)
FROM oauth_consumer_token
JOIN oauth_consumer_registry
ON oct_ocr_id_ref = ocr_id
WHERE oct_token_type = \'access\'
AND ocr_consumer_key = \'%s\'
AND oct_token_ttl >= NOW()
', $consumer_key);
return $count;
}