You are here

function synonyms_views_handler_filter_entityreference_synonyms::query in Synonyms 7

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter_numeric::query

File

views/synonyms_views_handler_filter_entityreference_synonyms.inc, line 96
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 query() {
  switch ($this->options['type']) {
    case 'synonyms_autocomplete':
      $field = field_info_field($this->definition['field_name']);
      $this->value['value'] = synonyms_get_entity_by_synonym($field['settings']['target_type'], $this->value['value'], synonyms_field_target_bundles($field));
      break;
  }
  parent::query();
}