function MemoryBackend::clear

Same name in other branches
  1. 9 core/lib/Drupal/Core/Flood/MemoryBackend.php \Drupal\Core\Flood\MemoryBackend::clear()
  2. 8.9.x core/lib/Drupal/Core/Flood/MemoryBackend.php \Drupal\Core\Flood\MemoryBackend::clear()
  3. 11.x core/lib/Drupal/Core/Flood/MemoryBackend.php \Drupal\Core\Flood\MemoryBackend::clear()

File

core/lib/Drupal/Core/Flood/MemoryBackend.php, line 50

Class

MemoryBackend
Defines the memory flood backend. This is used for testing.

Namespace

Drupal\Core\Flood

Code

public function clear($name, $identifier = NULL) {
    if (!isset($identifier)) {
        $identifier = $this->requestStack
            ->getCurrentRequest()
            ->getClientIp();
    }
    unset($this->events[$name][$identifier]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.