//model $query = DB::select('id', 'name')->from('users')->order_by('name'); //module adds a new column to select from and wants to order by something other than name without having to rebuild the query $query->select('order')->order_by('order'); //issue is, it still take in 'name' sorting before 'order' sorting //need something to clear out the $_order_by var in the class - fully, 1 part or sections based of column name // or an insert_(before/after) column name to change the ordering.. something like $query->clear('order_by') //or $query->clear('order_by', 'name') //or $query->order_by_before('name', 'order')
Harro Verton wrote on Tuesday 2nd of August 2011:The QB currently doesn't support modifications to things already set, it can only add new items. For the moment, the only solution is to extend the QB in your application (core/classes/database/query/builder/where.php) and add methods to unset things. You can add this as a feature request in the github issue tracker if you want, so we can consider this for the upcoming QB redesign.
Frank Bardon wrote on Monday 1st of August 2011:Couldn't you just set a variable $order_by and add to the query before you execute it? Or are you thinking of resorting it after it has been executed... You could just simply sort it with PHP...
It looks like you're new here. If you want to get involved, click one of these buttons!