You are here

public function ContextualBundle::query in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/filter/ContextualBundle.php \Drupal\entity_browser\Plugin\views\filter\ContextualBundle::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides Bundle::query

File

src/Plugin/views/filter/ContextualBundle.php, line 130

Class

ContextualBundle
Filter class which allows filtering by entity bundles.

Namespace

Drupal\entity_browser\Plugin\views\filter

Code

public function query() {
  if (empty($this->value)) {
    return;
  }
  $this
    ->ensureMyTable();

  // We use array_values() because the checkboxes keep keys and that can cause
  // array addition problems.
  $this->query
    ->addWhere($this->options['group'], "{$this->tableAlias}.{$this->realField}", array_values($this->value), 'in');
}