ListField.php in Drupal 10
File
core/modules/options/src/Plugin/views/filter/ListField.php
View source
<?php
namespace Drupal\options\Plugin\views\filter;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\filter\ManyToOne;
use Drupal\views\ViewExecutable;
class ListField extends ManyToOne {
use FieldAPIHandlerTrait;
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$field_storage = $this
->getFieldStorageDefinition();
$this->valueOptions = options_allowed_values($field_storage);
}
}
Classes
Name |
Description |
ListField |
Filter handler which uses list-fields as options. |