You are here

protected function PluginManagerBase::handlePluginNotFound in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Plugin/PluginManagerBase.php \Drupal\Component\Plugin\PluginManagerBase::handlePluginNotFound()
  2. 10 core/lib/Drupal/Component/Plugin/PluginManagerBase.php \Drupal\Component\Plugin\PluginManagerBase::handlePluginNotFound()

Allows plugin managers to specify custom behavior if a plugin is not found.

Parameters

string $plugin_id: The ID of the missing requested plugin.

array $configuration: An array of configuration relevant to the plugin instance.

Return value

object A fallback plugin instance.

2 calls to PluginManagerBase::handlePluginNotFound()
BlockManager::handlePluginNotFound in core/lib/Drupal/Core/Block/BlockManager.php
Allows plugin managers to specify custom behavior if a plugin is not found.
PluginManagerBase::createInstance in core/lib/Drupal/Component/Plugin/PluginManagerBase.php
Creates a pre-configured instance of a plugin.
1 method overrides PluginManagerBase::handlePluginNotFound()
BlockManager::handlePluginNotFound in core/lib/Drupal/Core/Block/BlockManager.php
Allows plugin managers to specify custom behavior if a plugin is not found.

File

core/lib/Drupal/Component/Plugin/PluginManagerBase.php, line 98

Class

PluginManagerBase
Base class for plugin managers.

Namespace

Drupal\Component\Plugin

Code

protected function handlePluginNotFound($plugin_id, array $configuration) {
  $fallback_id = $this
    ->getFallbackPluginId($plugin_id, $configuration);
  return $this
    ->getFactory()
    ->createInstance($fallback_id, $configuration);
}