You are here

public function Natural::init in Views Natural Sort 8.2

Initialize the plugin.

Parameters

\Drupal\views\ViewExecutable $view: The view object.

\Drupal\views\Plugin\views\display\DisplayPluginBase $display: The display handler.

array $options: The options configured for this plugin.

Overrides HandlerBase::init

File

src/Plugin/views/sort/Natural.php, line 29

Class

Natural
Sort plugin used to allow Natural Sorting.

Namespace

Drupal\views_natural_sort\Plugin\views\sort

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  $this
    ->setNaturalSort(substr($this->options['order'], 0, 1) == 'N');
}