function RulesComponentConfig::setContextDefinitions
Sets the definitions of the used context.
Parameters
\Drupal\rules\Context\ContextDefinitionInterface[] $definitions: The array of context definitions, keyed by context name.
Return value
$this
File
-
src/
Entity/ RulesComponentConfig.php, line 175
Class
- RulesComponentConfig
- Rules component configuration entity to persistently store configuration.
Namespace
Drupal\rules\EntityCode
public function setContextDefinitions(array $definitions) {
$this->component['context_definitions'] = [];
foreach ($definitions as $name => $definition) {
$this->component['context_definitions'][$name] = $definition->toArray();
}
return $this;
}