public function sio__vocabulary::queryOrder

3.x sio__vocabulary.inc public sio__vocabulary::queryOrder($query, $order)

Overrides ChadoField::queryOrder

See also

ChadoField::queryOrder()

File

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

Class

sio__vocabulary

Code

public function queryOrder($query, $order) {

  // If the table hasn't yet been joined then add it.
  $joins = $query->getTables();
  if (!in_array($this->field['field_name'], $joins)) {
    $alias = $this->field['field_name'];
    $this->queryJoinOnce($query, 'cv', $alias, "base.cv_id = $alias.cv_id");
    $query->orderBy("$alias.name", $order['direction']);
  }
}