Security update to Drupal 8.4.6
[yaffs-website] / web / core / modules / ban / src / BanIpManagerInterface.php
1 <?php
2
3 namespace Drupal\ban;
4
5 /**
6  * Provides an interface defining a BanIp manager.
7  */
8 interface BanIpManagerInterface {
9
10   /**
11    * Returns if this IP address is banned.
12    *
13    * @param string $ip
14    *   The IP address to check.
15    *
16    * @return bool
17    *   TRUE if the IP address is banned, FALSE otherwise.
18    */
19   public function isBanned($ip);
20
21   /**
22    * Finds all banned IP addresses.
23    *
24    * @return \Drupal\Core\Database\StatementInterface
25    *   The result of the database query.
26    */
27   public function findAll();
28
29   /**
30    * Bans an IP address.
31    *
32    * @param string $ip
33    *   The IP address to ban.
34    */
35   public function banIp($ip);
36
37   /**
38    * Unbans an IP address.
39    *
40    * @param string $id
41    *   The IP address to unban.
42    */
43   public function unbanIp($id);
44
45   /**
46    * Finds a banned IP address by its ID.
47    *
48    * @param int $ban_id
49    *   The ID for a banned IP address.
50    *
51    * @return string|false
52    *   Either the banned IP address or FALSE if none exist with that ID.
53    */
54   public function findById($ban_id);
55
56 }