class ResourcePluginCollection in RESTful 7.2
Hierarchy
- class \Drupal\Component\Plugin\LazyPluginCollection implements \Drupal\Component\Plugin\IteratorAggregate, \Drupal\Component\Plugin\Countable
- class \Drupal\Core\Plugin\DefaultLazyPluginCollection
- class \Drupal\restful\Resource\ResourcePluginCollection
- class \Drupal\Core\Plugin\DefaultLazyPluginCollection
Expanded class hierarchy of ResourcePluginCollection
File
- src/
Resource/ ResourcePluginCollection.php, line 12 - Contains \Drupal\restful\Resource\ResourcePluginCollection
Namespace
Drupal\restful\ResourceView source
class ResourcePluginCollection extends DefaultLazyPluginCollection {
/**
* The key within the plugin configuration that contains the plugin ID.
*
* @var string
*/
protected $pluginKey = 'name';
/**
* Overwrites LazyPluginCollection::get().
*/
public function &get($instance_id) {
/* @var \Drupal\restful\Plugin\resource\ResourceInterface $resource */
$resource = parent::get($instance_id);
// Allow altering the resource, this way we can read the resource's
// definition to return a different class that is using composition.
drupal_alter('restful_resource', $resource);
$resource = $resource
->isEnabled() ? $resource : NULL;
return $resource;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultLazyPluginCollection:: |
protected | property | The initial configuration for each plugin in the collection. | |
DefaultLazyPluginCollection:: |
protected | property | The manager used to instantiate the plugins. | |
DefaultLazyPluginCollection:: |
protected | property | The original order of the instances. | |
DefaultLazyPluginCollection:: |
public | function |
Adds an instance ID to the available instance IDs. Overrides LazyPluginCollection:: |
|
DefaultLazyPluginCollection:: |
public | function |
Gets the current configuration of all plugins in this collection. Overrides LazyPluginCollection:: |
|
DefaultLazyPluginCollection:: |
protected | function |
Initializes and stores a plugin. Overrides LazyPluginCollection:: |
|
DefaultLazyPluginCollection:: |
public | function |
Removes an instance ID. Overrides LazyPluginCollection:: |
|
DefaultLazyPluginCollection:: |
public | function |
Sets the configuration for all plugins in this collection. Overrides LazyPluginCollection:: |
|
DefaultLazyPluginCollection:: |
public | function | Updates the configuration for a plugin instance. | |
DefaultLazyPluginCollection:: |
public | function | Sorts all plugin instances in this collection. | |
DefaultLazyPluginCollection:: |
public | function | Provides uasort() callback to sort plugins. | |
DefaultLazyPluginCollection:: |
public | function | Constructs a new DefaultLazyPluginCollection object. | |
LazyPluginCollection:: |
protected | property | Stores the IDs of all potential plugin instances. | |
LazyPluginCollection:: |
protected | property | Stores all instantiated plugins. | |
LazyPluginCollection:: |
public | function | Clears all instantiated plugins. | |
LazyPluginCollection:: |
public | function | ||
LazyPluginCollection:: |
public | function | Gets all instance IDs. | |
LazyPluginCollection:: |
public | function | ||
LazyPluginCollection:: |
public | function | Determines if a plugin instance exists. | |
LazyPluginCollection:: |
public | function | Removes an initialized plugin. | |
LazyPluginCollection:: |
public | function | Stores an initialized plugin. | |
ResourcePluginCollection:: |
protected | property |
The key within the plugin configuration that contains the plugin ID. Overrides DefaultLazyPluginCollection:: |
|
ResourcePluginCollection:: |
public | function |
Overwrites LazyPluginCollection::get(). Overrides LazyPluginCollection:: |