You are here

public function RestfulBase::__construct in RESTful 7

Constructs a RestfulEntityBase object.

Parameters

array $plugin: Plugin definition.

RestfulAuthenticationManager $auth_manager: (optional) Injected authentication manager.

DrupalCacheInterface $cache_controller: (optional) Injected cache backend.

Overrides RestfulPluginBase::__construct

3 calls to RestfulBase::__construct()
RestfulDataProviderCToolsPlugins::__construct in plugins/restful/RestfulDataProviderCToolsPlugins.php
Constructs a RestfulDataProviderCToolsPlugins object.
RestfulDataProviderDbQuery::__construct in plugins/restful/RestfulDataProviderDbQuery.php
Constructs a RestfulDataProviderDbQuery object.
RestfulDataProviderEFQ::__construct in plugins/restful/RestfulDataProviderEFQ.php
Constructs a RestfulDataProviderEFQ object.
3 methods override RestfulBase::__construct()
RestfulDataProviderCToolsPlugins::__construct in plugins/restful/RestfulDataProviderCToolsPlugins.php
Constructs a RestfulDataProviderCToolsPlugins object.
RestfulDataProviderDbQuery::__construct in plugins/restful/RestfulDataProviderDbQuery.php
Constructs a RestfulDataProviderDbQuery object.
RestfulDataProviderEFQ::__construct in plugins/restful/RestfulDataProviderEFQ.php
Constructs a RestfulDataProviderEFQ object.

File

plugins/restful/RestfulBase.php, line 425
Contains RestfulBase.

Class

RestfulBase
Class \RestfulBase

Code

public function __construct(array $plugin, \RestfulAuthenticationManager $auth_manager = NULL, \DrupalCacheInterface $cache_controller = NULL, $langcode = NULL) {
  parent::__construct($plugin);
  $this->authenticationManager = $auth_manager ? $auth_manager : new \RestfulAuthenticationManager();
  $this->cacheController = $cache_controller ? $cache_controller : $this
    ->newCacheObject();
  if ($rate_limit = $this
    ->getPluginKey('rate_limit')) {
    $this
      ->setRateLimitManager(new \RestfulRateLimitManager($this
      ->getPluginKey('resource'), $rate_limit));
  }
  $this->staticCache = new \RestfulStaticCacheController();
  if (is_null($langcode)) {
    global $language;
    $this->langcode = $language->language;
  }
  else {
    $this->langcode = $langcode;
  }
}