public static function BlockedIpsExpireTestCase::numberTimesIpInDatabase in Blocked IPs Expire 7
Returns TRUE if an IP address is in the database.
Parameters
string $ip: The IP address to check.
Return value
int The number of times the IP address is in the database.
File
- tests/
blocked_ips_expire.base.test, line 50 - Contains \BlockedIpsExpireTestCase.
Class
- BlockedIpsExpireTestCase
- An object containing test functions common to all tests for this module.
Code
public static function numberTimesIpInDatabase($ip) {
$result = db_select('blocked_ips')
->condition('ip', $ip)
->countQuery()
->execute()
->fetchField();
return (int) $result;
}