DatabaseBackend::doInsert

protected DatabaseBackend::doInsert($name, $window, $identifier)

Inserts an event into the flood table

Parameters

string $name: The name of an event.

int $window: Number of seconds before this event expires.

string $identifier: Unique identifier of the current user.

See also

\Drupal\Core\Flood\DatabaseBackend::register

File

core/lib/Drupal/Core/Flood/DatabaseBackend.php, line 81

Class

DatabaseBackend
Defines the database flood backend. This is the default Drupal backend.

Namespace

Drupal\Core\Flood

Code

protected function doInsert($name, $window, $identifier) {
  $this->connection->insert(static::TABLE_NAME)
    ->fields(array(
      'event' => $name,
      'identifier' => $identifier,
      'timestamp' => REQUEST_TIME,
      'expiration' => REQUEST_TIME + $window,
    ))
    ->execute();
}
doc_Drupal
2016-10-29 08:59:37
Comments
Leave a Comment

Please login to continue.