class ContextDefinition in Rules 8.3
Same name in this branch
- 8.3 src/Context/ContextDefinition.php \Drupal\rules\Context\ContextDefinition
- 8.3 src/Context/Annotation/ContextDefinition.php \Drupal\rules\Context\Annotation\ContextDefinition
Extends the core context definition annotation object for Rules.
Ensures context definitions use \Drupal\rules\Context\ContextDefinitionInterface.
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\Core\Annotation\ContextDefinition
- class \Drupal\rules\Context\Annotation\ContextDefinition
- class \Drupal\Core\Annotation\ContextDefinition
Expanded class hierarchy of ContextDefinition
File
- src/
Context/ Annotation/ ContextDefinition.php, line 19
Namespace
Drupal\rules\Context\AnnotationView source
class ContextDefinition extends CoreContextDefinition {
/**
* The ContextDefinitionInterface object.
*
* @var \Drupal\rules\Context\ContextDefinitionInterface
*/
protected $definition;
/**
* {@inheritdoc}
*/
public function __construct(array $values) {
// Filter out any @Translation annotation objects.
foreach ($values as $key => $value) {
if ($value instanceof Translation) {
$values[$key] = $value
->get();
}
}
$this->definition = RulesContextDefinition::createFromArray($values);
}
/**
* Returns the value of an annotation.
*
* @return \Drupal\rules\Context\ContextDefinitionInterface
* Return the Rules version of the ContextDefinitionInterface.
*/
public function get() {
return $this->definition;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContextDefinition:: |
protected | property |
The ContextDefinitionInterface object. Overrides ContextDefinition:: |
|
ContextDefinition:: |
public | function |
Returns the value of an annotation. Overrides ContextDefinition:: |
|
ContextDefinition:: |
protected | function | Determines the context definition class to use. | |
ContextDefinition:: |
public | function |
Constructs a new context definition object. Overrides ContextDefinition:: |
|
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |