You are here

public function CustomFilter::addRule in Custom filter 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/CustomFilter.php \Drupal\customfilter\Entity\CustomFilter::addRule()

Add a new rule.

@todo throw an exception when the rule exist.

Parameters

array $rule: An array with a rule.

Return value

$this

File

src/Entity/CustomFilter.php, line 126

Class

CustomFilter
Defines the entity for a filter in customfilter.

Namespace

Drupal\customfilter\Entity

Code

public function addRule(array $rule) {
  $this->rules[$rule['rid']] = $rule;
  return $this;
}