You are here

public function OAuthStorePostgreSQL::countConsumerAccessTokens in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.2 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
  2. 7.3 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
  3. 7.4 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
  4. 7.5 lib/oauth-php/library/store/OAuthStorePostgreSQL.php \OAuthStorePostgreSQL::countConsumerAccessTokens()
  5. 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

OAuthStorePostgreSQL

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