You are here

protected function RateBotDetector::checkIp in Rate 8

Check if the IP-address exists in the local bot database.

Return value

bool TRUE if IP is in database; false otherwise.

1 call to RateBotDetector::checkIp()
RateBotDetector::checkIsBot in src/RateBotDetector.php
Check if the current user is blocked.

File

src/RateBotDetector.php, line 114

Class

RateBotDetector
The rate.bot_detector service.

Namespace

Drupal\rate

Code

protected function checkIp() {
  return (bool) $this->database
    ->select('rate_bot_ip', 'rbi')
    ->fields('rbi', [
    'id',
  ])
    ->condition('rbi.ip', $this->ip)
    ->range(0, 1)
    ->execute()
    ->fetchField();
}