You are here

public function CustomFilter::getRule in Custom filter 8

Same name and namespace in other branches
  1. 2.0.x 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 197

Class

CustomFilter
Defines the entify 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 array();
  }
}