You are here

protected function EntityReferenceFilterViewResult::getControllingFilters in Views Reference Filter 8

Get the controlling filters which are set as arguments.

Return value

array Controlling filters.

1 call to EntityReferenceFilterViewResult::getControllingFilters()
EntityReferenceFilterViewResult::afterBuild in src/Plugin/views/filter/EntityReferenceFilterViewResult.php
After build form callback for exposed form with entity reference filters.

File

src/Plugin/views/filter/EntityReferenceFilterViewResult.php, line 350

Class

EntityReferenceFilterViewResult
Filter by entity id using items got from the another view..

Namespace

Drupal\entityreference_filter\Plugin\views\filter

Code

protected function getControllingFilters() {
  $filters = [];
  if (isset($this->options['reference_arguments'])) {
    $arg_str = trim($this->options['reference_arguments']);
    if ($arg_str !== '') {
      $args = explode('/', $arg_str);
      foreach ($args as $arg) {
        $arg = trim($arg);
        $first_char = mb_substr($arg, 0, 1);
        if ($first_char === '[' && mb_substr($arg, -1, 1) === ']') {
          $filter_name = mb_substr($arg, 1, -1);
          $filters[] = $filter_name;
        }
      }
    }
  }
  return $filters;
}