Condition
class Condition extends Plugin (View source)
Defines a condition plugin annotation object.
Condition plugins provide generalized conditions for use in other operations, such as conditional block placement.
Plugin Namespace: Plugin\Condition
For a working example, see \Drupal\user\Plugin\Condition\UserRole.
Properties
| protected array | $definition | The plugin definition read from the class annotation. |
from Plugin |
| string | $id | The condition plugin ID. |
|
| Translation | $label | The human-readable name of the condition. |
|
| string | $module | The name of the module providing the type. |
|
| ContextDefinition[] | $context_definitions | An array of context definitions describing the context used by the plugin. |
|
| Translation | $category | The category under which the condition should listed in the UI. |
Methods
Details
in
Plugin at line 35
__construct($values)
Constructs a Plugin object.
Builds up the plugin definition and invokes the get() method for any classed annotations that were used.
in
Plugin at line 54
protected array
parse(array $values)
Parses an annotation into its definition.
in
Plugin at line 73
get()
Gets the value of an annotation.
in
Plugin at line 80
string
getProvider()
Gets the name of the provider of the annotated class.
in
Plugin at line 87
setProvider(string $provider)
Sets the name of the provider of the annotated class.
in
Plugin at line 94
string
getId()
Gets the unique ID for this annotated class.
string
getClass()
Gets the class of the annotated class.
setClass(string $class)
Sets the class of the annotated class.