You are here

function views_handler_filter_in_operator::operators in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 handlers/views_handler_filter_in_operator.inc \views_handler_filter_in_operator::operators()
  2. 7.3 handlers/views_handler_filter_in_operator.inc \views_handler_filter_in_operator::operators()

This kind of construct makes it relatively easy for a child class to add or remove functionality by overriding this function and adding/removing items from this array.

4 calls to views_handler_filter_in_operator::operators()
views_handler_filter_in_operator::admin_summary in handlers/views_handler_filter_in_operator.inc
Display the filter on the administrative summary
views_handler_filter_in_operator::operator_options in handlers/views_handler_filter_in_operator.inc
Build strings from the operators() for 'select' options
views_handler_filter_in_operator::operator_values in handlers/views_handler_filter_in_operator.inc
views_handler_filter_in_operator::query in handlers/views_handler_filter_in_operator.inc
Add this filter to the query.
1 method overrides views_handler_filter_in_operator::operators()
views_handler_filter_many_to_one::operators in handlers/views_handler_filter_many_to_one.inc
This kind of construct makes it relatively easy for a child class to add or remove functionality by overriding this function and adding/removing items from this array.

File

handlers/views_handler_filter_in_operator.inc, line 68

Class

views_handler_filter_in_operator
Simple filter to handle matching of multiple options selectable via checkboxes

Code

function operators() {
  $operators = array(
    'in' => array(
      'title' => t('Is one of'),
      'short' => t('in'),
      'short_single' => t('='),
      'method' => 'op_simple',
      'values' => 1,
    ),
    'not in' => array(
      'title' => t('Is not one of'),
      'short' => t('not in'),
      'short_single' => t('<>'),
      'method' => 'op_simple',
      'values' => 1,
    ),
  );

  // if the definition allows for the empty operator, add it.
  if (!empty($this->definition['allow empty'])) {
    $operators += array(
      'empty' => array(
        'title' => t('Is empty (NULL)'),
        'method' => 'op_empty',
        'short' => t('empty'),
        'values' => 0,
      ),
      'not empty' => array(
        'title' => t('Is not empty (NOT NULL)'),
        'method' => 'op_empty',
        'short' => t('not empty'),
        'values' => 0,
      ),
    );
  }
  return $operators;
}