You are here

interface ContextAwarePluginInterface in Drupal 8

Same name in this branch
  1. 8 core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php \Drupal\Core\Plugin\ContextAwarePluginInterface
  2. 8 core/lib/Drupal/Component/Plugin/ContextAwarePluginInterface.php \Drupal\Component\Plugin\ContextAwarePluginInterface
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/ContextAwarePluginInterface.php \Drupal\Core\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

Related topics

13 files declare their use of ContextAwarePluginInterface
BlockAccessControlHandler.php in core/modules/block/src/BlockAccessControlHandler.php
BlockForm.php in core/modules/block/src/BlockForm.php
BlockRepositoryTest.php in core/modules/block/tests/src/Unit/BlockRepositoryTest.php
Contains \Drupal\Tests\block\Unit\BlockRepositoryTest.
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 14

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\PluginException
   *   If the requested context is not defined.
   */
  public function getContextDefinition($name);

}

Members

Namesort descending Modifiers Type Description 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. 1
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. 1
ContextAwarePluginInterface::setContextMapping public function Sets a mapping of the expected assignment names to their context names. 1
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. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2