You are here

public function BanIpManager::isBanned in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/ban/src/BanIpManager.php \Drupal\ban\BanIpManager::isBanned()

Returns if this IP address is banned.

Parameters

string $ip: The IP address to check.

Return value

bool TRUE if the IP address is banned, FALSE otherwise.

Overrides BanIpManagerInterface::isBanned

File

core/modules/ban/src/BanIpManager.php, line 37
Contains \Drupal\ban\BanIpManager.

Class

BanIpManager
Ban IP manager.

Namespace

Drupal\ban

Code

public function isBanned($ip) {
  return (bool) $this->connection
    ->query("SELECT * FROM {ban_ip} WHERE ip = :ip", array(
    ':ip' => $ip,
  ))
    ->fetchField();
}