You are here

BooleanEntity.php in Configuration Views 8

Same filename and directory in other branches
  1. 2.0.x src/Plugin/views/filter/BooleanEntity.php

File

src/Plugin/views/filter/BooleanEntity.php
View source
<?php

namespace Drupal\config_views\Plugin\views\filter;

use Drupal\views\Plugin\views\filter\BooleanOperator;

/**
 * Views filter for boolean to work with config entities.
 *
 * @ViewsFilter("config_entity_boolean")
 */
class BooleanEntity extends BooleanOperator {

  /**
   * {@inheritdoc}
   */
  public function query() {
    $field = $this->realField;
    $info = $this
      ->operators();
    if (!empty($info[$this->operator]['method'])) {
      call_user_func([
        $this,
        $info[$this->operator]['method'],
      ], $field, $info[$this->operator]['query_operator']);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function queryOpBoolean($field, $query_operator = self::EQUAL) {
    $this->query
      ->condition($this->options['group'], $field, $this->value, $this->operator);
  }

}

Classes

Namesort descending Description
BooleanEntity Views filter for boolean to work with config entities.