trait DiscoveryCachedTrait
Same name in other branches
- 9 core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait
- 8.9.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait
- 10 core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait
Hierarchy
- trait \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait uses \Drupal\Component\Plugin\Discovery\DiscoveryTrait
2 files declare their use of DiscoveryCachedTrait
- DefaultPluginManager.php in core/
lib/ Drupal/ Core/ Plugin/ DefaultPluginManager.php - DiscoveryCachedTraitTest.php in core/
tests/ Drupal/ Tests/ Component/ Plugin/ Discovery/ DiscoveryCachedTraitTest.php
File
-
core/
lib/ Drupal/ Component/ Plugin/ Discovery/ DiscoveryCachedTrait.php, line 5
Namespace
Drupal\Component\Plugin\DiscoveryView source
trait DiscoveryCachedTrait {
use DiscoveryTrait;
/**
* Cached definitions array.
*
* @var array
*/
protected $definitions;
/**
* {@inheritdoc}
*/
public function getDefinition($plugin_id, $exception_on_invalid = TRUE) {
// Fetch definitions if they're not loaded yet.
if (!isset($this->definitions)) {
$this->getDefinitions();
}
return $this->doGetDefinition($this->definitions, $plugin_id, $exception_on_invalid);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
DiscoveryCachedTrait::$definitions | protected | property | Cached definitions array. | 1 | |
DiscoveryCachedTrait::getDefinition | public | function | Overrides DiscoveryTrait::getDefinition | 3 | |
DiscoveryTrait::doGetDefinition | protected | function | Gets a specific plugin definition. | ||
DiscoveryTrait::getDefinitions | abstract public | function | 17 | ||
DiscoveryTrait::hasDefinition | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.