You are here

public function WorkflowState::init in Workflow 8

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 ManyToOne::init

File

src/Plugin/views/filter/WorkflowState.php, line 24

Class

WorkflowState
Filter handler which uses workflow_state as options.

Namespace

Drupal\workflow\Plugin\views\filter

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  $wid = isset($this->definition['wid']) ? $this->definition['wid'] : '';
  $grouped = isset($options['group_info']['widget']) ? $options['group_info']['widget'] == 'select' : FALSE;
  $this->valueOptions = workflow_get_workflow_state_names($wid, $grouped);
}