function PluginManagerBase::getFallbackPluginId

Same name in other branches
  1. 11.x core/lib/Drupal/Component/Plugin/PluginManagerBase.php \Drupal\Component\Plugin\PluginManagerBase::getFallbackPluginId()

Gets a fallback id for a missing plugin.

This method should be implemented in extending classes that also implement FallbackPluginManagerInterface. It is called by PluginManagerBase::handlePluginNotFound on the abstract class, and therefore should be defined as well on the abstract class to prevent static analysis errors.

Parameters

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

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

Return value

string The id of an existing plugin to use when the plugin does not exist.

Throws

\BadMethodCallException If the method is not implemented in the concrete plugin manager class.

1 call to PluginManagerBase::getFallbackPluginId()
PluginManagerBase::handlePluginNotFound in core/lib/Drupal/Component/Plugin/PluginManagerBase.php
Allows plugin managers to specify custom behavior if a plugin is not found.
6 methods override PluginManagerBase::getFallbackPluginId()
BlockManager::getFallbackPluginId in core/lib/Drupal/Core/Block/BlockManager.php
Gets a fallback id for a missing plugin.
FieldTypeCategoryManager::getFallbackPluginId in core/lib/Drupal/Core/Field/FieldTypeCategoryManager.php
Gets a fallback id for a missing plugin.
FilterPluginManager::getFallbackPluginId in core/modules/filter/src/FilterPluginManager.php
Gets a fallback id for a missing plugin.
SelectionPluginManager::getFallbackPluginId in core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php
Gets a fallback id for a missing plugin.
StubFallbackPluginManager::getFallbackPluginId in core/tests/Drupal/Tests/Component/Plugin/StubFallbackPluginManager.php
Gets a fallback id for a missing plugin.

... See full list

File

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

Class

PluginManagerBase
Base class for plugin managers.

Namespace

Drupal\Component\Plugin

Code

protected function getFallbackPluginId($plugin_id, array $configuration = []) {
    throw new \BadMethodCallException(static::class . '::getFallbackPluginId() not implemented.');
}

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