You are here

public function Articles__1_4::__construct in RESTful 7.2

Constructs an Articles__1_4 object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides ResourceEntity::__construct

File

modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_4.php, line 47
Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_4.

Class

Articles__1_4
Class Articles__1_4 @package Drupal\restful\Plugin\resource

Namespace

Drupal\restful_example\Plugin\resource\node\article\v1

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->pluginDefinition['rateLimit'] = array(
    // The 'request' event is the basic event. You can declare your own
    // events.
    'request' => array(
      'event' => 'request',
      // Rate limit is cleared every day.
      'period' => 'P1D',
      'limits' => array(
        'authenticated user' => 3,
        'anonymous user' => 2,
        'administrator' => RateLimitManager::UNLIMITED_RATE_LIMIT,
      ),
    ),
  );
}