public function OAuthStoreOracle::countServerTokens in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::countServerTokens()
- 7.2 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::countServerTokens()
- 7.3 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::countServerTokens()
- 7.5 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::countServerTokens()
- 7.6 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::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/ OAuthStoreOracle.php, line 530
Class
Code
public function countServerTokens($consumer_key) {
//
$count = 0;
$sql = "BEGIN SP_COUNT_SERVICE_TOKENS(:P_CONSUMER_KEY, :P_COUNT, :P_RESULT); END;";
// parse sql
$stmt = oci_parse($this->conn, $sql) or die('Can not parse query');
// Bind In and Out Variables
oci_bind_by_name($stmt, ':P_CONSUMER_KEY', $consumer_key, 255);
oci_bind_by_name($stmt, ':P_COUNT', $count, 40);
oci_bind_by_name($stmt, ':P_RESULT', $result, 20);
//Execute the statement
oci_execute($stmt);
//
return $count;
}