function DiscoveryInterface::getDefinition

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php \Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition()
  2. 8.9.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php \Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition()
  3. 11.x core/lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php \Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition()

Gets a specific plugin definition.

Parameters

string $plugin_id: A plugin id.

bool $exception_on_invalid: (optional) If TRUE, an invalid plugin ID will throw an exception.

Return value

mixed A plugin definition, or NULL if the plugin ID is invalid and $exception_on_invalid is FALSE.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException Thrown if $plugin_id is invalid and $exception_on_invalid is TRUE.

1 method overrides DiscoveryInterface::getDefinition()
EntityTypeManagerInterface::getDefinition in core/lib/Drupal/Core/Entity/EntityTypeManagerInterface.php

File

core/lib/Drupal/Component/Plugin/Discovery/DiscoveryInterface.php, line 27

Class

DiscoveryInterface
Defines the minimum requirements for a plugin discovery component.

Namespace

Drupal\Component\Plugin\Discovery

Code

public function getDefinition($plugin_id, $exception_on_invalid = TRUE);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.