interface BanIpManagerInterface (View source)

Provides an interface defining a BanIp manager.

Methods

bool
isBanned(string $ip)

Returns if this IP address is banned.

findAll()

Finds all banned IP addresses.

banIp(string $ip)

Bans an IP address.

unbanIp(string $id)

Unbans an IP address.

string|false
findById(int $ban_id)

Finds a banned IP address by its ID.

Details

bool isBanned(string $ip)

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.

StatementInterface findAll()

Finds all banned IP addresses.

Return Value

StatementInterface

The result of the database query.

banIp(string $ip)

Bans an IP address.

Parameters

string $ip

The IP address to ban.

unbanIp(string $id)

Unbans an IP address.

Parameters

string $id

The IP address to unban.

string|false findById(int $ban_id)

Finds a banned IP address by its ID.

Parameters

int $ban_id

The ID for a banned IP address.

Return Value

string|false

Either the banned IP address or FALSE if none exist with that ID.