class StaticDiscovery in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Component/Plugin/Discovery/StaticDiscovery.php \Drupal\Component\Plugin\Discovery\StaticDiscovery
A discovery mechanism that allows plugin definitions to be manually registered rather than actively discovered.
Hierarchy
- class \Drupal\Component\Plugin\Discovery\StaticDiscovery implements DiscoveryInterface uses DiscoveryCachedTrait
Expanded class hierarchy of StaticDiscovery
5 files declare their use of StaticDiscovery
- DefaultsTestPluginManager.php in core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ DefaultsTestPluginManager.php - Contains \Drupal\plugin_test\Plugin\DefaultsTestPluginManager.
- MockBlockManager.php in core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ MockBlockManager.php - Contains \Drupal\plugin_test\Plugin\MockBlockManager.
- StaticDiscoveryTest.php in core/
modules/ system/ src/ Tests/ Plugin/ Discovery/ StaticDiscoveryTest.php - Contains \Drupal\system\Tests\Plugin\Discovery\StaticDiscoveryTest.
- TestPluginManager.php in core/
tests/ Drupal/ Tests/ Core/ Plugin/ TestPluginManager.php - Contains \Drupal\Tests\Core\Plugin\TestPluginManager.
- TestPluginManager.php in core/
modules/ system/ tests/ modules/ plugin_test/ src/ Plugin/ TestPluginManager.php - Contains \Drupal\plugin_test\Plugin\TestPluginManager.
File
- core/
lib/ Drupal/ Component/ Plugin/ Discovery/ StaticDiscovery.php, line 14 - Contains \Drupal\Component\Plugin\Discovery\StaticDiscovery.
Namespace
Drupal\Component\Plugin\DiscoveryView source
class StaticDiscovery implements DiscoveryInterface {
use DiscoveryCachedTrait;
/**
* {@inheritdoc}
*/
public function getDefinitions() {
if (!$this->definitions) {
$this->definitions = array();
}
return $this->definitions;
}
/**
* Sets a plugin definition.
*/
public function setDefinition($plugin, $definition) {
$this->definitions[$plugin] = $definition;
}
/**
* Deletes a plugin definition.
*/
public function deleteDefinition($plugin) {
unset($this->definitions[$plugin]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DiscoveryCachedTrait:: |
protected | property | Cached definitions array. | 1 |
DiscoveryCachedTrait:: |
public | function |
Overrides DiscoveryTrait:: |
3 |
DiscoveryTrait:: |
protected | function | Gets a specific plugin definition. | |
DiscoveryTrait:: |
public | function | ||
StaticDiscovery:: |
public | function | Deletes a plugin definition. | |
StaticDiscovery:: |
public | function |
Gets the definition of all plugins for this type. Overrides DiscoveryTrait:: |
1 |
StaticDiscovery:: |
public | function | Sets a plugin definition. |