StaticDiscovery.php in Drupal 8
File
core/lib/Drupal/Component/Plugin/Discovery/StaticDiscovery.php
View source
<?php
namespace Drupal\Component\Plugin\Discovery;
class StaticDiscovery implements DiscoveryInterface {
use DiscoveryCachedTrait;
public function getDefinitions() {
if (!$this->definitions) {
$this->definitions = [];
}
return $this->definitions;
}
public function setDefinition($plugin, $definition) {
$this->definitions[$plugin] = $definition;
}
public function deleteDefinition($plugin) {
unset($this->definitions[$plugin]);
}
}
Classes
Name |
Description |
StaticDiscovery |
A discovery mechanism that allows plugin definitions to be manually
registered rather than actively discovered. |