You are here

function synonyms_views_handler_filter_entityreference_synonyms::operators in Synonyms 7

Overrides views_handler_filter_numeric::operators

File

views/synonyms_views_handler_filter_entityreference_synonyms.inc, line 42
Definition of synonyms_views_handler_filter_entityreference_synonyms class.

Class

synonyms_views_handler_filter_entityreference_synonyms
Definition of synonyms friendly entity reference field filter.

Code

function operators() {
  $operators = parent::operators();
  switch ($this->options['type']) {
    case 'synonyms_autocomplete':
    case 'synonyms_select':

      // Only "equals" and "not equals" make sense, other operators are rather
      // funky when it comes to IDs and not simple integers.
      $operators = array_intersect_key($operators, drupal_map_assoc(array(
        '=',
        '!=',
      )));
      break;
  }
  return $operators;
}