You are here

public function OAuthStoreSQL::countConsumerAccessTokens in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.2 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countConsumerAccessTokens()
  2. 7.3 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countConsumerAccessTokens()
  3. 7.4 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countConsumerAccessTokens()
  4. 7.5 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countConsumerAccessTokens()
  5. 7.6 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::countConsumerAccessTokens()

* Count the consumer access tokens for the given consumer. * *

Parameters

string consumer_key: * @return int

Overrides OAuthStoreAbstract::countConsumerAccessTokens

File

lib/oauth-php/library/store/OAuthStoreSQL.php, line 1316

Class

OAuthStoreSQL

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;
}