You are here

public function DiscoveryCachedTrait::getDefinition in Plug 7

Overrides DiscoveryTrait::getDefinition

1 call to DiscoveryCachedTrait::getDefinition()
StaticDiscoveryDecorator::getDefinition in lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php
1 method overrides DiscoveryCachedTrait::getDefinition()
StaticDiscoveryDecorator::getDefinition in lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php

File

lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php, line 24
Contains \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait.

Class

DiscoveryCachedTrait

Namespace

Drupal\Component\Plugin\Discovery

Code

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);
}