1 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.
File
- core/
modules/ views/ handlers/ views_handler_filter_in_operator.inc, line 100 - Definition of views_handler_filter_in_operator.
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;
}