1. 8.5.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php DiscoveryCachedTrait
  2. 8.0.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php DiscoveryCachedTrait
  3. 8.1.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php DiscoveryCachedTrait
  4. 8.2.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php DiscoveryCachedTrait
  5. 8.3.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php DiscoveryCachedTrait
  6. 8.4.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php DiscoveryCachedTrait
  7. 8.6.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php DiscoveryCachedTrait

Hierarchy

1 file declares its use of DiscoveryCachedTrait
DefaultPluginManager.php in core/lib/Drupal/Core/Plugin/DefaultPluginManager.php

File

core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php, line 5

Namespace

Drupal\Component\Plugin\Discovery
View 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

Contains filters are case sensitive
Namesort descending Modifiers Type Description Overrides
DiscoveryCachedTrait::$definitions protected property Cached definitions array.
DiscoveryCachedTrait::getDefinition public function Gets a specific plugin definition. Overrides DiscoveryTrait::getDefinition
DiscoveryTrait::doGetDefinition protected function Gets a specific plugin definition.
DiscoveryTrait::getDefinitions abstract public function
DiscoveryTrait::hasDefinition public function Indicates if a specific plugin definition exists. Overrides DiscoveryInterface::hasDefinition