order()

order($field, $orderType = "ASC", $override = false)

It will order your results based on given params
@param String $field
@param String $orderType
@param Boolean $override
@return PhpBURN_Core

Params


$field
Wich will order the results, usualy a field but can be anything that your database accepts, ex: $model->order(‘id_user’) or $model->order(‘COUNT(id_user)’), etc.

$field (optional)
By default it comes as “DESC” but you can change to “ASC” anytime you fill this option.

Explanation


It will help you to order or results putting a ORDER BY mclause in your query.

Default Usage

$user = new Users();

$user->order('id_user');
$user->find();

That will bring yours users ORDER BY id_user DESC

ASC order example

Default Usage

$user = new Users();

$user->order('id_user','ASC');
$user->find();