You are here

public function CacheDecoratedResource::__construct in RESTful 7.2

Constructs a Drupal\Component\Plugin\PluginBase object.

Parameters

ResourceInterface $subject: The decorated object.

\DrupalCacheInterface $cache_controller: Injected cache manager.

File

src/Plugin/resource/Decorators/CacheDecoratedResource.php, line 47
Contains \Drupal\restful\Plugin\resource\Decorators\CacheDecoratedResource

Class

CacheDecoratedResource

Namespace

Drupal\restful\Plugin\resource\Decorators

Code

public function __construct(ResourceInterface $subject, \DrupalCacheInterface $cache_controller = NULL) {

  // TODO: Implement the ResourceManager factory to use the CacheDecoratedResource.
  $this->subject = $subject;
  $this->cacheController = $cache_controller ? $cache_controller : $this
    ->newCacheObject();
  $cache_info = $this
    ->defaultCacheInfo();
  $this->pluginDefinition['renderCache'] = $cache_info;
}