You are here

public function Rule::getActions in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/Entity/Rule.php \Drupal\rng\Entity\Rule::getActions()
  2. 8 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\Entity

Code

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';
  }));
}