function DatabaseBackend::clearByPrefix
Makes the flood control mechanism forget an event by identifier prefix.
Parameters
string $name: The name of an event.
string $prefix: The prefix of the identifier to be cleared.
Overrides PrefixFloodInterface::clearByPrefix
File
- 
              core/
lib/ Drupal/ Core/ Flood/ DatabaseBackend.php, line 120  
Class
- DatabaseBackend
 - Defines the database flood backend. This is the default Drupal backend.
 
Namespace
Drupal\Core\FloodCode
public function clearByPrefix(string $name, string $prefix) : void {
  try {
    $this->connection
      ->delete(static::TABLE_NAME)
      ->condition('event', $name)
      ->condition('identifier', $prefix . '-%', 'LIKE')
      ->execute();
  } catch (\Exception $e) {
    $this->catchException($e);
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.