You are here

class NoreqnewpassFlood in No Request New Password 8

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

Hierarchy

Expanded class hierarchy of NoreqnewpassFlood

File

src/Services/NoreqnewpassFlood.php, line 11

Namespace

Drupal\noreqnewpass\Services
View source
class NoreqnewpassFlood {

  /**
   * The flood service.
   *
   * @var \Drupal\Core\Flood\FloodInterface
   */
  protected $flood;

  /**
   * Constructs a new UserLoginForm.
   *
   * @param \Drupal\Core\Flood\FloodInterface $flood
   *   The flood service.
   */
  public function __construct(FloodInterface $flood) {
    $this->flood = $flood;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('flood'));
  }

  /**
   * Implements Drupal\noreqnewpass\NoreqnewpassFlood::register().
   */
  public function noreqnewpassregister($name, $window = 3600, $identifier = NULL) {
    $this->flood
      ->register($name, $window = 3600, $identifier);
  }

  /**
   * Implements Drupal\noreqnewpass\NoreqnewpassFlood::clear().
   */
  public function noreqnewpassclear($name, $identifier = NULL) {
    $this->flood
      ->clear($name, $identifier);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NoreqnewpassFlood::$flood protected property The flood service.
NoreqnewpassFlood::create public static function
NoreqnewpassFlood::noreqnewpassclear public function Implements Drupal\noreqnewpass\NoreqnewpassFlood::clear().
NoreqnewpassFlood::noreqnewpassregister public function Implements Drupal\noreqnewpass\NoreqnewpassFlood::register().
NoreqnewpassFlood::__construct public function Constructs a new UserLoginForm.