interface ContextAwarePluginInterface

Same name in this branch
  1. 9 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface
Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php \Drupal\Core\Plugin\ContextAwarePluginInterface
  2. 8.9.x core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface
  3. 10 core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php \Drupal\Core\Plugin\ContextAwarePluginInterface
  4. 10 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface
  5. 11.x core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php \Drupal\Core\Plugin\ContextAwarePluginInterface
  6. 11.x core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface

An override of ContextAwarePluginInterface for documentation purposes.

Hierarchy

Expanded class hierarchy of ContextAwarePluginInterface

All classes that implement ContextAwarePluginInterface

See also

\Drupal\Component\Plugin\ContextAwarePluginInterface

\Drupal\Core\Plugin\ContextAwarePluginTrait

Related topics

21 files declare their use of ContextAwarePluginInterface
BlockAccessControlHandler.php in core/modules/block/src/BlockAccessControlHandler.php
BlockBase.php in core/lib/Drupal/Core/Block/BlockBase.php
BlockForm.php in core/modules/block/src/BlockForm.php
BlockViewBuilder.php in core/modules/block/src/BlockViewBuilder.php
ConfigureBlockFormBase.php in core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php

... See full list

File

core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php, line 15

Namespace

Drupal\Core\Plugin
View source
interface ContextAwarePluginInterface extends ComponentContextAwarePluginInterface {
    
    /**
     * Gets the context definitions of the plugin.
     *
     * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface[]
     *   The array of context definitions, keyed by context name.
     */
    public function getContextDefinitions();
    
    /**
     * Gets a specific context definition of the plugin.
     *
     * @param string $name
     *   The name of the context in the plugin definition.
     *
     * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface
     *   The definition against which the context value must validate.
     *
     * @throws \Drupal\Component\Plugin\Exception\ContextException
     *   If the requested context is not defined.
     */
    public function getContextDefinition($name);

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ContextAwarePluginInterface::getContext public function Gets a defined context. 1
ContextAwarePluginInterface::getContextDefinition public function Gets a specific context definition of the plugin. Overrides ContextAwarePluginInterface::getContextDefinition
ContextAwarePluginInterface::getContextDefinitions public function Gets the context definitions of the plugin. Overrides ContextAwarePluginInterface::getContextDefinitions
ContextAwarePluginInterface::getContextMapping public function Gets a mapping of the expected assignment names to their context names.
ContextAwarePluginInterface::getContexts public function Gets the defined contexts. 1
ContextAwarePluginInterface::getContextValue public function Gets the value for a defined context. 1
ContextAwarePluginInterface::getContextValues public function Gets the values for all defined contexts. 1
ContextAwarePluginInterface::setContext public function Set a context on this plugin. 2
ContextAwarePluginInterface::setContextMapping public function Sets a mapping of the expected assignment names to their context names.
ContextAwarePluginInterface::setContextValue public function Sets the value for a defined context. 1
ContextAwarePluginInterface::validateContexts public function Validates the set values for the defined contexts. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2

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