You are here

protected function SortPluginBase::defineOptions in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::defineOptions()
  2. 10 core/modules/views/src/Plugin/views/sort/SortPluginBase.php \Drupal\views\Plugin\views\sort\SortPluginBase::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides HandlerBase::defineOptions

1 call to SortPluginBase::defineOptions()
Date::defineOptions in core/modules/views/src/Plugin/views/sort/Date.php
Information about options for all kinds of purposes will be held here.
1 method overrides SortPluginBase::defineOptions()
Date::defineOptions in core/modules/views/src/Plugin/views/sort/Date.php
Information about options for all kinds of purposes will be held here.

File

core/modules/views/src/Plugin/views/sort/SortPluginBase.php, line 44

Class

SortPluginBase
Base sort handler that has no options and performs a simple sort.

Namespace

Drupal\views\Plugin\views\sort

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['order'] = [
    'default' => 'ASC',
  ];
  $options['exposed'] = [
    'default' => FALSE,
  ];
  $options['expose'] = [
    'contains' => [
      'label' => [
        'default' => '',
      ],
    ],
  ];
  return $options;
}