function ListField::init

Same name and namespace in other branches
  1. 9 core/modules/options/src/Plugin/views/filter/ListField.php \Drupal\options\Plugin\views\filter\ListField::init()
  2. 10 core/modules/options/src/Plugin/views/filter/ListField.php \Drupal\options\Plugin\views\filter\ListField::init()
  3. 11.x core/modules/options/src/Plugin/views/filter/ListField.php \Drupal\options\Plugin\views\filter\ListField::init()

Overrides ManyToOne::init

File

core/modules/options/src/Plugin/views/filter/ListField.php, line 24

Class

ListField
Filter handler which uses list-fields as options.

Namespace

Drupal\options\Plugin\views\filter

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);
    $field_storage = $this->getFieldStorageDefinition();
    // Set valueOptions here so getValueOptions() will just return it.
    $this->valueOptions = options_allowed_values($field_storage);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.