You are here

interface ContextAwarePluginInterface in Drupal 10

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

\Drupal\Core\Plugin\ContextAwarePluginTrait

Related topics

20 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