You are here

public function RuleComponent::setRule in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Entity/RuleComponent.php \Drupal\rng\Entity\RuleComponent::setRule()
  2. 3.x src/Entity/RuleComponent.php \Drupal\rng\Entity\RuleComponent::setRule()

Sets the rule for the component.

Return value

\Drupal\rng\RuleComponentInterface Return this object for chaining.

Overrides RuleComponentInterface::setRule

File

src/Entity/RuleComponent.php, line 48

Class

RuleComponent
Defines a event rule plugin instance entity: a condition or action.

Namespace

Drupal\rng\Entity

Code

public function setRule(RuleInterface $rule) {
  $this
    ->set('rule', [
    'entity' => $rule,
  ]);
  return $this;
}