You are here

public function FloodInterface::register in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Core/Flood/FloodInterface.php \Drupal\Core\Flood\FloodInterface::register()

Registers an event for the current visitor to the flood control mechanism.

Parameters

string $name: The name of an event. To prevent unintended name clashes, it is recommended to use the module name first in the event name, optionally followed by a dot and the actual event name (e.g. "mymodule.my_event").

int $window: (optional) Number of seconds before this event expires. Defaults to 3600 (1 hour). Typically uses the same value as the isAllowed() $window parameter. Expired events are purged on cron run to prevent the flood table from growing indefinitely.

string $identifier: (optional) Unique identifier of the current user. Defaults to the current user's IP address).

1 method overrides FloodInterface::register()
LegacyBackend::register in src/Flood/LegacyBackend.php
Implements Drupal\Core\Flood\FloodInterface::register().

File

lib/Drupal/Core/Flood/FloodInterface.php, line 31
Contains \Drupal\Core\Flood\FloodInterface.

Class

FloodInterface
Defines an interface for flood controllers.

Namespace

Drupal\Core\Flood

Code

public function register($name, $window = 3600, $identifier = NULL);