function select($select = '*', $escape = NULL)
{
// Set the global value if this was sepecified
if (is_bool($escape)) {
$this->_protect_identifiers = $escape;
}
if (is_string($select)) {
$select = explode(',', $select);
}
foreach ($select as $val) {
$val = trim($val);
if ($val != '') {
$this->ar_select[] = $val;
if ($this->ar_caching === TRUE) {
$this->ar_cache_select[] = $val;
$this->ar_cache_exists[] = 'select';
}
}
}
return $this;
}
public function setup_order(CI_DB_active_record $db) { $db->join('annotation2scope AS order_annotation2scope', 'order_annotation2scope.annotation_id = annotation.annotation_id'); $db->join('scope AS order_scope', 'order_scope.scope_id = order_annotation2scope.scope_id'); if ($this->desc === TRUE) { $db->select('order_scope.to_index'); $db->order_by('order_scope.to_index', $this->get_direction()); } else { $db->select('order_scope.from_index'); $db->order_by('order_scope.from_index'); } return $db; }