You are here

public function BooleanOperator::init in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/BooleanOperator.php \Drupal\views\Plugin\views\filter\BooleanOperator::init()

Overrides \Drupal\views\Plugin\views\HandlerBase::init().

Provide some extra help to get the operator/value easier to use.

This likely has to be overridden by filters which are more complex than simple operator/value.

Overrides FilterPluginBase::init

1 call to BooleanOperator::init()
Current::init in core/modules/user/src/Plugin/views/filter/Current.php
Overrides \Drupal\views\Plugin\views\HandlerBase::init().
1 method overrides BooleanOperator::init()
Current::init in core/modules/user/src/Plugin/views/filter/Current.php
Overrides \Drupal\views\Plugin\views\HandlerBase::init().

File

core/modules/views/src/Plugin/views/filter/BooleanOperator.php, line 88

Class

BooleanOperator
Simple filter to handle matching of boolean values

Namespace

Drupal\views\Plugin\views\filter

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  $this->value_value = $this
    ->t('True');
  if (isset($this->definition['label'])) {
    $this->value_value = $this->definition['label'];
  }
  elseif (isset($this->definition['title'])) {
    $this->value_value = $this->definition['title'];
  }
  if (isset($this->definition['accept null'])) {
    $this->accept_null = (bool) $this->definition['accept null'];
  }
  elseif (isset($this->definition['accept_null'])) {
    $this->accept_null = (bool) $this->definition['accept_null'];
  }
  $this->valueOptions = NULL;
}