class ResourcePluginManager in RESTful 7.2
Hierarchy
- class \Drupal\restful\Plugin\ResourcePluginManager extends \Drupal\Core\Plugin\DefaultPluginManager
Expanded class hierarchy of ResourcePluginManager
4 files declare their use of ResourcePluginManager
- DataProviderResource.php in src/
Plugin/ resource/ DataProvider/ DataProviderResource.php - Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderResource.
- OAuth2ServerAuthentication.php in src/
Plugin/ authentication/ OAuth2ServerAuthentication.php - ResourceFieldFileEntityReference.php in src/
Plugin/ resource/ Field/ ResourceFieldFileEntityReference.php - Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldFileEntityReference.
- ResourceManager.php in src/
Resource/ ResourceManager.php - Contains \Drupal\restful\Resource\ResourceManager.
File
- src/
Plugin/ ResourcePluginManager.php, line 15 - Contains \Drupal\restful\Plugin\ResourcePluginManager.
Namespace
Drupal\restful\PluginView source
class ResourcePluginManager extends DefaultPluginManager {
/**
* Request object.
*
* @var RequestInterface
*/
protected $request;
/**
* Constructs ResourcePluginManager.
*
* @param \Traversable $namespaces
* An object that implements \Traversable which contains the root paths
* keyed by the corresponding namespace to look for plugin implementations.
* @param \DrupalCacheInterface $cache_backend
* Cache backend instance to use.
* @param RequestInterface $request
* The request object.
*/
public function __construct(\Traversable $namespaces, \DrupalCacheInterface $cache_backend, RequestInterface $request) {
parent::__construct('Plugin/resource', $namespaces, 'Drupal\\restful\\Plugin\\resource\\ResourceInterface', '\\Drupal\\restful\\Annotation\\Resource');
$this
->setCacheBackend($cache_backend, 'resource_plugins');
$this
->alterInfo('resource_plugin');
$this->request = $request;
}
/**
* ResourcePluginManager factory method.
*
* @param string $bin
* The cache bin for the plugin manager.
* @param RequestInterface $request
* The request object.
*
* @return ResourcePluginManager
* The created manager.
*/
public static function create($bin = 'cache', RequestInterface $request = NULL) {
return new static(Module::getNamespaces(), _cache_get_object($bin), $request);
}
/**
* Overrides PluginManagerBase::createInstance().
*
* This method is overridden to set the request object when the resource
* object is instantiated.
*/
public function createInstance($plugin_id, array $configuration = array()) {
/* @var ResourceInterface $resource */
$resource = parent::createInstance($plugin_id, $configuration);
$resource
->setRequest($this->request);
return $resource;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ResourcePluginManager:: |
protected | property | Request object. | |
ResourcePluginManager:: |
public static | function | ResourcePluginManager factory method. | |
ResourcePluginManager:: |
public | function | Overrides PluginManagerBase::createInstance(). | |
ResourcePluginManager:: |
public | function | Constructs ResourcePluginManager. |