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.
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;
}