You are here

interface RateLimitManagerInterface in RESTful 7.2

Hierarchy

Expanded class hierarchy of RateLimitManagerInterface

All classes that implement RateLimitManagerInterface

File

src/RateLimit/RateLimitManagerInterface.php, line 13
Contains \Drupal\restful\RateLimit\RateLimitManagerInterface

Namespace

Drupal\restful\RateLimit
View source
interface RateLimitManagerInterface {

  /**
   * Set the account.
   *
   * @param object $account
   */
  public function setAccount($account);

  /**
   * Get the account.
   *
   * @return object
   *   The account object,
   */
  public function getAccount();

  /**
   * Checks if the current request has reached the rate limit.
   *
   * If the user has reached the limit this method will throw an exception. If
   * not, the hits counter will be updated for subsequent calls. Since the
   * request can match multiple events, the access is only granted if all events
   * are cleared.
   *
   * @param RequestInterface $request
   *   The request array.
   *
   * @throws FloodException if the rate limit has been reached for the
   * current request.
   */
  public function checkRateLimit(RequestInterface $request);

  /**
   * Delete all expired rate limit entities.
   */
  public static function deleteExpired();

}

Members

Namesort descending Modifiers Type Description Overrides
RateLimitManagerInterface::checkRateLimit public function Checks if the current request has reached the rate limit. 1
RateLimitManagerInterface::deleteExpired public static function Delete all expired rate limit entities. 1
RateLimitManagerInterface::getAccount public function Get the account. 1
RateLimitManagerInterface::setAccount public function Set the account. 1