function Numeric::operators in Views (for Drupal 7) 8.3
8 calls to Numeric::operators()
- Date::acceptExposedInput in lib/
Drupal/ views/ Plugin/ views/ filter/ Date.php - Do some minor translation of the exposed input
- Date::validateValidTime in lib/
Drupal/ views/ Plugin/ views/ filter/ Date.php - Validate that the time values convert to something usable.
- GroupByNumeric::query in lib/
Drupal/ views/ Plugin/ views/ filter/ GroupByNumeric.php - Add this filter to the query.
- NcsLastUpdated::query in lib/
Views/ comment/ Plugin/ views/ filter/ NcsLastUpdated.php - Add this filter to the query.
- Numeric::acceptExposedInput in lib/
Drupal/ views/ Plugin/ views/ filter/ Numeric.php - Do some minor translation of the exposed input
File
- lib/
Drupal/ views/ Plugin/ views/ filter/ Numeric.php, line 40 - Definition of Drupal\views\Plugin\views\filter\Numeric.
Class
- Numeric
- Simple filter to handle greater than/less than filters
Namespace
Drupal\views\Plugin\views\filterCode
function operators() {
$operators = array(
'<' => array(
'title' => t('Is less than'),
'method' => 'op_simple',
'short' => t('<'),
'values' => 1,
),
'<=' => array(
'title' => t('Is less than or equal to'),
'method' => 'op_simple',
'short' => t('<='),
'values' => 1,
),
'=' => array(
'title' => t('Is equal to'),
'method' => 'op_simple',
'short' => t('='),
'values' => 1,
),
'!=' => array(
'title' => t('Is not equal to'),
'method' => 'op_simple',
'short' => t('!='),
'values' => 1,
),
'>=' => array(
'title' => t('Is greater than or equal to'),
'method' => 'op_simple',
'short' => t('>='),
'values' => 1,
),
'>' => array(
'title' => t('Is greater than'),
'method' => 'op_simple',
'short' => t('>'),
'values' => 1,
),
'between' => array(
'title' => t('Is between'),
'method' => 'op_between',
'short' => t('between'),
'values' => 2,
),
'not between' => array(
'title' => t('Is not between'),
'method' => 'op_between',
'short' => t('not between'),
'values' => 2,
),
);
// 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,
),
);
}
// Add regexp support for MySQL.
if (Database::getConnection()
->databaseType() == 'mysql') {
$operators += array(
'regular_expression' => array(
'title' => t('Regular expression'),
'short' => t('regex'),
'method' => 'op_regex',
'values' => 1,
),
);
}
return $operators;
}