You are here

protected function SqlBase::defineOptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/pager/SqlBase.php \Drupal\views\Plugin\views\pager\SqlBase::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 PluginBase::defineOptions

2 calls to SqlBase::defineOptions()
Full::defineOptions in core/modules/views/src/Plugin/views/pager/Full.php
Information about options for all kinds of purposes will be held here.
Mini::defineOptions in core/modules/views/src/Plugin/views/pager/Mini.php
Overrides \Drupal\views\Plugin\views\pager\PagerPlugin::defineOptions().
2 methods override SqlBase::defineOptions()
Full::defineOptions in core/modules/views/src/Plugin/views/pager/Full.php
Information about options for all kinds of purposes will be held here.
Mini::defineOptions in core/modules/views/src/Plugin/views/pager/Mini.php
Overrides \Drupal\views\Plugin\views\pager\PagerPlugin::defineOptions().

File

core/modules/views/src/Plugin/views/pager/SqlBase.php, line 19
Contains \Drupal\views\Plugin\views\pager\SqlBase.

Class

SqlBase
A common base class for sql based pager.

Namespace

Drupal\views\Plugin\views\pager

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['items_per_page'] = array(
    'default' => 10,
  );
  $options['offset'] = array(
    'default' => 0,
  );
  $options['id'] = array(
    'default' => 0,
  );
  $options['total_pages'] = array(
    'default' => '',
  );
  $options['expose'] = array(
    'contains' => array(
      'items_per_page' => array(
        'default' => FALSE,
      ),
      'items_per_page_label' => array(
        'default' => $this
          ->t('Items per page'),
      ),
      'items_per_page_options' => array(
        'default' => '5, 10, 25, 50',
      ),
      'items_per_page_options_all' => array(
        'default' => FALSE,
      ),
      'items_per_page_options_all_label' => array(
        'default' => $this
          ->t('- All -'),
      ),
      'offset' => array(
        'default' => FALSE,
      ),
      'offset_label' => array(
        'default' => $this
          ->t('Offset'),
      ),
    ),
  );
  $options['tags'] = array(
    'contains' => array(
      'previous' => array(
        'default' => $this
          ->t('‹ Previous'),
      ),
      'next' => array(
        'default' => $this
          ->t('Next ›'),
      ),
    ),
  );
  return $options;
}