public function chado_linker__prop::query
3.x chado_linker__prop.inc | public chado_linker__prop::query($query, $condition) |
Overrides ChadoField::query
See also
File
- tripal_chado/
includes/ TripalFields/ chado_linker__prop/ chado_linker__prop.inc, line 142
Class
Code
public function query($query, $condition) {
$prop_linker = $this->instance['settings']['chado_table'];
$base_table = $this->instance['settings']['base_table'];
$bschema = chado_get_schema($base_table);
$bpkey = $bschema['primary key'][0];
$alias = $this->field['field_name'];
$operator = $condition['operator'];
$vocab = $this->instance['settings']['term_vocabulary'];
$accession = $this->instance['settings']['term_accession'];
$cvterm = chado_get_cvterm(array('id' => $vocab . ':' . $accession));
$this->queryJoinOnce($query, $prop_linker, $alias, "base.$bpkey = $alias.$bpkey");
$query->condition("$alias.type_id", $cvterm->cvterm_id);
$query->condition("$alias.value", $condition['value'], $operator);
}