You are here

public function DiscoveryCachedTrait::getDefinition in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait::getDefinition()
  2. 10 core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait::getDefinition()

Overrides DiscoveryTrait::getDefinition

18 calls to DiscoveryCachedTrait::getDefinition()
ArchiverManager::createInstance in core/lib/Drupal/Core/Archiver/ArchiverManager.php
Creates a pre-configured instance of a plugin.
EntityTypeManager::getDefinition in core/lib/Drupal/Core/Entity/EntityTypeManager.php
Gets a specific plugin definition.
FieldTypePluginManager::getDefaultFieldSettings in core/lib/Drupal/Core/Field/FieldTypePluginManager.php
Returns the default field-level settings for a field type.
FieldTypePluginManager::getDefaultStorageSettings in core/lib/Drupal/Core/Field/FieldTypePluginManager.php
Returns the default storage-level settings for a field type.
FormatterPluginManager::createInstance in core/lib/Drupal/Core/Field/FormatterPluginManager.php
Creates a pre-configured instance of a plugin.

... See full list

3 methods override DiscoveryCachedTrait::getDefinition()
EntityTypeManager::getDefinition in core/lib/Drupal/Core/Entity/EntityTypeManager.php
Gets a specific plugin definition.
StaticDiscoveryDecorator::getDefinition in core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php
TypedConfigManager::getDefinition in core/lib/Drupal/Core/Config/TypedConfigManager.php
Gets a specific plugin definition.

File

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

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