public function Rule::getActions in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/Entity/Rule.php \Drupal\rng\Entity\Rule::getActions()
- 3.x src/Entity/Rule.php \Drupal\rng\Entity\Rule::getActions()
Get actions for the rule.
Return value
\Drupal\rng\Entity\RuleComponentInterface[] An array of action entities.
Overrides RuleInterface::getActions
File
- src/
Entity/ Rule.php, line 93
Class
- Rule
- Defines the event rule entity.
Namespace
Drupal\rng\EntityCode
public function getActions() {
$ids = \Drupal::entityQuery('rng_rule_component')
->condition('rule', $this
->id(), '=')
->condition('type', 'action', '=')
->execute();
return array_merge($ids ? RuleComponent::loadMultiple($ids) : [], array_filter($this->components_unsaved, function ($component) {
return $component
->getType() == 'action';
}));
}