public function DiscoveryInterface::getDefinition in Drupal 9
Same name and namespace in other branches
- 8 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.
4 methods override DiscoveryInterface::getDefinition()
- EntityTypeManagerInterface::getDefinition in core/
lib/ Drupal/ Core/ Entity/ EntityTypeManagerInterface.php - LayoutPluginManagerInterface::getDefinition in core/
lib/ Drupal/ Core/ Layout/ LayoutPluginManagerInterface.php - MenuLinkManager::getDefinition in core/
lib/ Drupal/ Core/ Menu/ MenuLinkManager.php - Gets a specific plugin definition.
- TypedConfigManagerInterface::getDefinition in core/
lib/ Drupal/ Core/ Config/ TypedConfigManagerInterface.php - Gets a specific plugin definition.
File
- core/
lib/ Drupal/ Component/ Plugin/ Discovery/ DiscoveryInterface.php, line 28
Class
- DiscoveryInterface
- An interface defining the minimum requirements of building a plugin discovery component.
Namespace
Drupal\Component\Plugin\DiscoveryCode
public function getDefinition($plugin_id, $exception_on_invalid = TRUE);