protected function FilterPluginBase::defineOptions

Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

  • 'default' => default value,
  • 'translatable' => (optional) TRUE/FALSE (wrap in t() on export if true),
  • '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().
  • 'bool' => (optional) TRUE/FALSE Is the value a boolean value. This will change the export format to TRUE/FALSE instead of 1/0.

),

Return value

array Returns the options of this handler/plugin.

Overrides HandlerBase::defineOptions

6 calls to FilterPluginBase::defineOptions()
BooleanOperator::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
FilterTest::defineOptions in drupal/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/filter/FilterTest.php
Overrides Drupal\views\Plugin\views\row\RowPluginBase::defineOptions().
InOperator::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Numeric::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Search::defineOptions in drupal/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

... See full list

7 methods override FilterPluginBase::defineOptions()
BooleanOperator::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Broken::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Broken.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
FilterTest::defineOptions in drupal/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/filter/FilterTest.php
Overrides Drupal\views\Plugin\views\row\RowPluginBase::defineOptions().
InOperator::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Numeric::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php, line 111
Definition of Drupal\views\Plugin\views\filter\FilterPluginBase.

Class

FilterPluginBase
Base class for filters.

Namespace

Drupal\views\Plugin\views\filter

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['operator'] = array(
    'default' => '=',
  );
  $options['value'] = array(
    'default' => '',
  );
  $options['group'] = array(
    'default' => '1',
  );
  $options['exposed'] = array(
    'default' => FALSE,
    'bool' => TRUE,
  );
  $options['expose'] = array(
    'contains' => array(
      'operator_id' => array(
        'default' => FALSE,
      ),
      'label' => array(
        'default' => '',
        'translatable' => TRUE,
      ),
      'description' => array(
        'default' => '',
        'translatable' => TRUE,
      ),
      'use_operator' => array(
        'default' => FALSE,
        'bool' => TRUE,
      ),
      'operator' => array(
        'default' => '',
      ),
      'identifier' => array(
        'default' => '',
      ),
      'required' => array(
        'default' => FALSE,
        'bool' => TRUE,
      ),
      'remember' => array(
        'default' => FALSE,
        'bool' => TRUE,
      ),
      'multiple' => array(
        'default' => FALSE,
        'bool' => TRUE,
      ),
      'remember_roles' => array(
        'default' => array(
          DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID,
        ),
      ),
    ),
  );

  // A group is a combination of a filter, an operator and a value
  // operating like a single filter.
  // Users can choose from a select box which group they want to apply.
  // Views will filter the view according to the defined values.
  // Because it acts as a standard filter, we have to define
  // an identifier and other settings like the widget and the label.
  // This settings are saved in another array to allow users to switch
  // between a normal filter and a group of filters with a single click.
  $options['is_grouped'] = array(
    'default' => FALSE,
    'bool' => TRUE,
  );
  $options['group_info'] = array(
    'contains' => array(
      'label' => array(
        'default' => '',
        'translatable' => TRUE,
      ),
      'description' => array(
        'default' => '',
        'translatable' => TRUE,
      ),
      'identifier' => array(
        'default' => '',
      ),
      'optional' => array(
        'default' => TRUE,
        'bool' => TRUE,
      ),
      'widget' => array(
        'default' => 'select',
      ),
      'multiple' => array(
        'default' => FALSE,
        'bool' => TRUE,
      ),
      'remember' => array(
        'default' => 0,
      ),
      'default_group' => array(
        'default' => 'All',
      ),
      'default_group_multiple' => array(
        'default' => array(),
      ),
      'group_items' => array(
        'default' => array(),
      ),
    ),
  );
  return $options;
}