public function uo__unit::query

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

Overrides ChadoField::query

See also

ChadoField::query()

File

tripal_chado/includes/TripalFields/uo__unit/uo__unit.inc, line 69

Class

uo__unit

Code

public function query($query, $condition) {
  $chado_table = $this->instance['settings']['chado_table']; // featuremap
  $chado_field = $this->instance['settings']['chado_column']; // unittype_id

  $alias = $this->field['field_name'];
  $operator = $condition['operator'];

  $this->queryJoinOnce($query, 'cvterm', $alias, "base.$chado_field = $alias.cvterm_id");
  $query->condition("$alias.name", $condition['value'], $operator);
}