interface PluginContextDefinitionInterface in Plugin 8.2
Defines a plugin definition that includes contexts.
Hierarchy
- interface \Drupal\Component\Plugin\Definition\PluginDefinitionInterface
- interface \Drupal\plugin\PluginDefinition\PluginDefinitionInterface
- interface \Drupal\plugin\PluginDefinition\PluginContextDefinitionInterface
- interface \Drupal\plugin\PluginDefinition\PluginDefinitionInterface
Expanded class hierarchy of PluginContextDefinitionInterface
All classes that implement PluginContextDefinitionInterface
File
- src/
PluginDefinition/ PluginContextDefinitionInterface.php, line 12
Namespace
Drupal\plugin\PluginDefinitionView source
interface PluginContextDefinitionInterface extends PluginDefinitionInterface {
/**
* Sets the context definitions.
*
* @param \Drupal\Component\Plugin\Context\ContextDefinitionInterface[] $context_definitions
* The array of context definitions, keyed by context name.
*
* @return $this
*
* @throws \InvalidArgumentException
* Thrown if the definitions are invalid.
*/
public function setContextDefinitions(array $context_definitions);
/**
* Gets the context definitions.
*
* @return \Drupal\Component\Plugin\Context\ContextDefinitionInterface[]
* The array of context definitions, keyed by context name.
*/
public function getContextDefinitions();
/**
* Sets a specific context definition.
*
* @param string $name
* The name of the context in the plugin definition.
* @param \Drupal\Component\Plugin\Context\ContextDefinitionInterface $context_definition
* The context definition to set.
*
* @return $this
*/
public function setContextDefinition($name, ContextDefinitionInterface $context_definition);
/**
* Gets a specific context definition.
*
* @param string $name
* The name of the context in the plugin definition.
*
* @throws \InvalidArgumentException
* If the requested context does not exist.
*
* @return \Drupal\Component\Plugin\Context\ContextDefinitionInterface
*
* @see self::hasContextDefinition()
*/
public function getContextDefinition($name);
/**
* Checks if a specific context definition exists.
*
* @param string $name
* The name of the context in the plugin definition.
*
* @return bool
* Whether the context definition exists.
*/
public function hasContextDefinition($name);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginContextDefinitionInterface:: |
public | function | Gets a specific context definition. | 1 |
PluginContextDefinitionInterface:: |
public | function | Gets the context definitions. | 1 |
PluginContextDefinitionInterface:: |
public | function | Checks if a specific context definition exists. | 1 |
PluginContextDefinitionInterface:: |
public | function | Sets a specific context definition. | 1 |
PluginContextDefinitionInterface:: |
public | function | Sets the context definitions. | 1 |
PluginDefinitionInterface:: |
public | function | Gets the class. | 1 |
PluginDefinitionInterface:: |
public | function | Gets the plugin ID. | 2 |
PluginDefinitionInterface:: |
public | function |
Gets the plugin provider. Overrides PluginDefinitionInterface:: |
2 |
PluginDefinitionInterface:: |
public | function | Gets the unique identifier of the plugin. | 1 |
PluginDefinitionInterface:: |
public | function | Merges another definition into this one, using the other for defaults. | |
PluginDefinitionInterface:: |
public | function | Merges another definition into this one, using the other for overrides. | |
PluginDefinitionInterface:: |
public | function | Sets the class. | 1 |
PluginDefinitionInterface:: |
public | function | Sets the plugin ID. | 2 |
PluginDefinitionInterface:: |
public | function | Sets the plugin provider. | 2 |