Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PluginManagerBase.php

function 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.

Throws

\BadMethodCallException When ::getFallbackPluginId() is not implemented in the concrete plugin manager class.

3 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.
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
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 102

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal