public function PluginManagerBase::getDefinition in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Plugin/PluginManagerBase.php \Drupal\Component\Plugin\PluginManagerBase::getDefinition()
- 9 core/lib/Drupal/Component/Plugin/PluginManagerBase.php \Drupal\Component\Plugin\PluginManagerBase::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.
Overrides DiscoveryTrait::getDefinition
1 call to PluginManagerBase::getDefinition()
- MigratePluginManager::createInstance in core/
modules/ migrate/ src/ Plugin/ MigratePluginManager.php - Creates a pre-configured instance of a migration plugin.
File
- core/
lib/ Drupal/ Component/ Plugin/ PluginManagerBase.php, line 57
Class
- PluginManagerBase
- Base class for plugin managers.
Namespace
Drupal\Component\PluginCode
public function getDefinition($plugin_id, $exception_on_invalid = TRUE) {
return $this
->getDiscovery()
->getDefinition($plugin_id, $exception_on_invalid);
}