A discovery mechanism that allows plugin definitions to be manually registered rather than actively discovered.
Expanded class hierarchy of StaticDiscovery
class StaticDiscovery implements DiscoveryInterface {
/**
* The array of plugin definitions, keyed by plugin id.
*
* @var array
*/
protected $definitions = array();
/**
* Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition().
*/
public function getDefinition($base_plugin_id) {
return isset($this->definitions[$base_plugin_id]) ? $this->definitions[$base_plugin_id] : NULL;
}
/**
* Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinitions().
*/
public function getDefinitions() {
return $this->definitions;
}
/**
* Sets a plugin definition.
*/
public function setDefinition($plugin, array $definition) {
$this->definitions[$plugin] = $definition;
}
/**
* Deletes a plugin definition.
*/
public function deleteDefinition($plugin) {
unset($this->definitions[$plugin]);
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StaticDiscovery:: |
protected | property | The array of plugin definitions, keyed by plugin id. | |
StaticDiscovery:: |
public | function | Deletes a plugin definition. | |
StaticDiscovery:: |
public | function |
Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition(). Overrides DiscoveryInterface:: |
1 |
StaticDiscovery:: |
public | function |
Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinitions(). Overrides DiscoveryInterface:: |
1 |
StaticDiscovery:: |
public | function | Sets a plugin definition. |