CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

$qb_orderby should be public

Open aanbar opened this issue 13 years ago • 4 comments

The new Query Builder define "order by" array as protected which prevents it from being accessed from a custom MY_Model.

aanbar avatar May 19 '13 16:05 aanbar

Why would you need to access the property?

narfbg avatar Oct 21 '13 11:10 narfbg

I forgot the exact reason I needed it, but it was something like setting default order_by for a model only if no order_by was set.

if no elements in qb_orderby then we use the default order by.

aanbar avatar Oct 21 '13 11:10 aanbar

If you do already have an order by condition, then having another order_by() call would just add another one with lower precedence - that couldn't do any harm, I guess?

Edit: My point is - why bother?

narfbg avatar Oct 21 '13 11:10 narfbg

Yes, I guess & looks like it doesn't generate a problem in MySQL when you "order by id desc, id asc" it will take the first one & forget the other :)

aanbar avatar Oct 21 '13 16:10 aanbar