interface ContextAwarePluginDefinitionInterface in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionInterface.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface
- 9 core/lib/Drupal/Component/Plugin/Definition/ContextAwarePluginDefinitionInterface.php \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface
Provides an interface for plugin definitions which use contexts.
Hierarchy
- interface \Drupal\Component\Plugin\Definition\PluginDefinitionInterface
- interface \Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface
Expanded class hierarchy of ContextAwarePluginDefinitionInterface
All classes that implement ContextAwarePluginDefinitionInterface
6 files declare their use of ContextAwarePluginDefinitionInterface
- ContextAwarePluginTrait.php in core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginTrait.php - ContextAwarePluginTraitTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Plugin/ Context/ ContextAwarePluginTraitTest.php - ContextHandler.php in core/
lib/ Drupal/ Core/ Plugin/ Context/ ContextHandler.php - ContextHandlerTest.php in core/
tests/ Drupal/ Tests/ Core/ Plugin/ ContextHandlerTest.php - Contains \Drupal\Tests\Core\Plugin\ContextHandlerTest.
- LayoutDefinition.php in core/
lib/ Drupal/ Core/ Layout/ LayoutDefinition.php
File
- core/
lib/ Drupal/ Component/ Plugin/ Definition/ ContextAwarePluginDefinitionInterface.php, line 12
Namespace
Drupal\Component\Plugin\DefinitionView source
interface ContextAwarePluginDefinitionInterface extends PluginDefinitionInterface {
/**
* Checks if the plugin defines a particular context.
*
* @param string $name
* The context name.
*
* @return bool
* TRUE if the plugin defines the given context, otherwise FALSE.
*/
public function hasContextDefinition($name);
/**
* Returns all context definitions for this plugin.
*
* @return \Drupal\Component\Plugin\Context\ContextDefinitionInterface[]
* The context definitions.
*/
public function getContextDefinitions();
/**
* Returns a particular context definition for this plugin.
*
* @param string $name
* The context name.
*
* @return \Drupal\Component\Plugin\Context\ContextDefinitionInterface
* The context definition.
*
* @throws \Drupal\Component\Plugin\Exception\ContextException
* Thrown if the plugin does not define the given context.
*/
public function getContextDefinition($name);
/**
* Adds a context to this plugin definition.
*
* @param string $name
* The context name.
* @param \Drupal\Component\Plugin\Context\ContextDefinitionInterface $definition
* The context definition.
*
* @return $this
* The called object.
*/
public function addContextDefinition($name, ContextDefinitionInterface $definition);
/**
* Removes a context definition from this plugin.
*
* @param string $name
* The context name.
*
* @return $this
* The called object.
*/
public function removeContextDefinition($name);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContextAwarePluginDefinitionInterface:: |
public | function | Adds a context to this plugin definition. | |
ContextAwarePluginDefinitionInterface:: |
public | function | Returns a particular context definition for this plugin. | |
ContextAwarePluginDefinitionInterface:: |
public | function | Returns all context definitions for this plugin. | |
ContextAwarePluginDefinitionInterface:: |
public | function | Checks if the plugin defines a particular context. | |
ContextAwarePluginDefinitionInterface:: |
public | function | Removes a context definition from this plugin. | |
PluginDefinitionInterface:: |
public | function | Gets the class. | 1 |
PluginDefinitionInterface:: |
public | function | Gets the plugin provider. | 1 |
PluginDefinitionInterface:: |
public | function | Gets the unique identifier of the plugin. | 1 |
PluginDefinitionInterface:: |
public | function | Sets the class. | 1 |