public function local__source_data::query

3.x local__source_data.inc public local__source_data::query($query, $condition)

Overrides ChadoField::query

See also

ChadoField::query()

File

tripal_chado/includes/TripalFields/local__source_data/local__source_data.inc, line 111

Class

local__source_data

Code

public function query($query, $condition) {
  $operator = $condition['operator'];

  $field_term_id = $this->getFieldTermID();
  $sourcename_term = $field_term_id . ',' . chado_get_semweb_term('analysis', 'sourcename');
  $sourceversion_term = $field_term_id . ',' . chado_get_semweb_term('analysis', 'sourceversion');
  $sourceuri_term = $field_term_id . ',' . chado_get_semweb_term('analysis', 'sourceuri');

  if ($condition['column'] == $sourcename_term) {
    $query->condition("base.sourcename", $condition['value'], $operator);
  }
  if ($condition['column'] == $sourceversion_term) {
    $query->condition("base.sourceversion", $condition['value'], $operator);
  }
}