You are here

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

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

Get one rule.

@todo trown an exception if the rule do not exist.

Parameters

string $rid: The id of the requested rule.

Return value

array The rule requested.

File

src/Entity/CustomFilter.php, line 212

Class

CustomFilter
Defines the entity for a filter in customfilter.

Namespace

Drupal\customfilter\Entity

Code

public function getRule($rid) {
  if (isset($this->rules[$rid])) {
    return $this->rules[$rid];
  }
  else {
    return [];
  }
}