public function data__accession::queryOrder
3.x data__accession.inc | public data__accession::queryOrder($query, $order) |
Overrides ChadoField::queryOrder
See also
File
- tripal_chado/
includes/ TripalFields/ data__accession/ data__accession.inc, line 104
Class
Code
public function queryOrder($query, $order) {
$alias = $this->field['field_name'];
$operator = $condition['operator'];
$field_table = $this->instance['settings']['chado_table'];
$field_column = $this->instance['settings']['chado_column'];
$field_term_id = $this->getFieldTermID();
$accession_term = chado_get_semweb_term($field_table, $field_column);
// We don't offer any sub elements so the value coming in should
// always be the field_name.
if ($order['column'] == $accession_term) {
$this->queryJoinOnce($query, 'dbxref', 'DBX', "DBX.dbxref_id = base.dbxref_id", "LEFT OUTER");
$query->orderBy("DBX.accession", $order['direction']);
}
}