Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Order results from Kohana ORM

Tags:

php

orm

kohana

I'm using Kohana's ORM library, and I'm wondering if there is any way to order the results that are generated.

Example:

$priorities = ORM::factory('priority')->select_list('id','label'); //how to order these?
like image 482
GSto Avatar asked Oct 05 '10 01:10

GSto


1 Answers

What is select_list?

Btw, ordering in kohana is performed by order_by() method

...->order_by('field', 'asc')

More samples you can find at: http://kerkness.ca/kowiki/doku.php?id=building_complex_select_statements#order_by

Also that wiki contains a lot of usefull articles about kohana: http://kerkness.ca/kowiki/doku.php

like image 151
zerkms Avatar answered Oct 18 '22 13:10

zerkms