public function ResourcePluginManager::__construct

Overrides Drupal\Component\Plugin\PluginManagerBase::__construct().

Parameters

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations,

File

drupal/core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php, line 29
Definition of Drupal\rest\Plugin\Type\ResourcePluginManager.

Class

ResourcePluginManager
Manages discovery and instantiation of resource plugins.

Namespace

Drupal\rest\Plugin\Type

Code

public function __construct(\Traversable $namespaces) {

  // Create resource plugin derivatives from declaratively defined resources.
  $this->discovery = new AnnotatedClassDiscovery('rest/resource', $namespaces);
  $this->discovery = new DerivativeDiscoveryDecorator($this->discovery);
  $this->discovery = new AlterDecorator($this->discovery, 'rest_resource');
  $this->discovery = new CacheDecorator($this->discovery, 'rest');
  $this->factory = new ReflectionFactory($this->discovery);
}