public function ContextDefinition::__construct in Rules 8.3
Same name in this branch
- 8.3 src/Context/ContextDefinition.php \Drupal\rules\Context\ContextDefinition::__construct()
- 8.3 src/Context/Annotation/ContextDefinition.php \Drupal\rules\Context\Annotation\ContextDefinition::__construct()
Constructs a new context definition object.
Parameters
string $data_type: The required data type.
string|null $label: The label of this context definition for the UI.
bool $required: Whether the context definition is required.
bool $multiple: Whether the context definition is multivalue.
string|null $description: The description of this context definition for the UI.
mixed $default_value: The default value of this definition.
Overrides ContextDefinition::__construct
File
- src/
Context/ ContextDefinition.php, line 57
Class
- ContextDefinition
- Extends the core context definition class with useful methods.
Namespace
Drupal\rules\ContextCode
public function __construct($data_type = 'any', $label = NULL, $required = TRUE, $multiple = FALSE, $description = NULL, $default_value = NULL) {
$this->dataType = $data_type;
$this->label = $label;
$this->isRequired = $required;
$this->isMultiple = $multiple;
$this->description = $description;
$this->defaultValue = $default_value;
}