public function OAuthStorePostgreSQL::countServerTokens in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countServerTokens()
- 7.2 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countServerTokens()
- 7.3 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countServerTokens()
- 7.5 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countServerTokens()
- 7.6 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countServerTokens()
Count how many tokens we have for the given server
Parameters
string consumer_key:
Return value
int
Overrides OAuthStoreAbstract::countServerTokens
File
- lib/
oauth-php/ library/ store/ OAuthStorePostgreSQL.php, line 563
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;
}