function ListField::init
Same name in other branches
- 8.9.x core/modules/options/src/Plugin/views/filter/ListField.php \Drupal\options\Plugin\views\filter\ListField::init()
- 10 core/modules/options/src/Plugin/views/filter/ListField.php \Drupal\options\Plugin\views\filter\ListField::init()
- 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\filterCode
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.