You are here

public function RateLimitGlobal::generateIdentifier in RESTful 7.2

Generates an identifier for the event and the request.

Parameters

object $account: The account object for the user making the request.

Return value

string The ID.

Overrides RateLimit::generateIdentifier

File

src/Plugin/rate_limit/RateLimitGlobal.php, line 39
Contains \Drupal\restful\Plugin\rate_limit\RateLimitGlobal

Class

RateLimitGlobal
Class RateLimitGlobal @package Drupal\restful\Plugin\rate_limit

Namespace

Drupal\restful\Plugin\rate_limit

Code

public function generateIdentifier($account = NULL) {
  $identifier = '';
  $identifier .= $this
    ->getPluginId() . PluginBase::DERIVATIVE_SEPARATOR;
  $identifier .= empty($account->uid) ? ip_address() : $account->uid;
  return $identifier;
}