You are here

protected function NullSort::sortOptions in Views Sort Null Field 1.x

Same name and namespace in other branches
  1. 8 src/Plugin/views/sort/NullSort.php \Drupal\views_sort_null_field\Plugin\views\sort\NullSort::sortOptions()
  2. 9.1.x src/Plugin/views/sort/NullSort.php \Drupal\views_sort_null_field\Plugin\views\sort\NullSort::sortOptions()

Provide a list of options for the default sort form.

Should be overridden by classes that don't override sort_form

Overrides SortPluginBase::sortOptions

File

src/Plugin/views/sort/NullSort.php, line 33

Class

NullSort
Basic sort handler for NULL values.

Namespace

Drupal\views_sort_null_field\Plugin\views\sort

Code

protected function sortOptions() {

  // ASC puts NULL last, as ISNULL is 1 for NULLs, and 0 for non-NULLs.
  return array(
    'ASC' => $this
      ->t('Sort NULL last'),
    'DESC' => $this
      ->t('Sort NULL first'),
  );
}