You are here

public function StringArgument::init in Drupal 8

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

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

Overrides ArgumentPluginBase::init

1 call to StringArgument::init()
StringListField::init in core/modules/options/src/Plugin/views/argument/StringListField.php
Overrides Drupal\views\Plugin\views\HandlerBase:init().
1 method overrides StringArgument::init()
StringListField::init in core/modules/options/src/Plugin/views/argument/StringListField.php
Overrides Drupal\views\Plugin\views\HandlerBase:init().

File

core/modules/views/src/Plugin/views/argument/StringArgument.php, line 25

Class

StringArgument
Basic argument handler to implement string arguments that may have length limits.

Namespace

Drupal\views\Plugin\views\argument

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  if (!empty($this->definition['many to one'])) {
    $this->helper = new ManyToOneHelper($this);

    // Ensure defaults for these, during summaries and stuff:
    $this->operator = 'or';
    $this->value = [];
  }
}