public function order($field, $desc = false)
    {
        if(count($this->models) > 0) {
            $instance = $this->reflection->newInstance();
            $string = $instance->isString($field);
            usort($this->models, function ($a, $b) use ($field, $string) {
                if($string) {
                    return strcmp($a[$field], $b[$field]);
                }
                return $a[$field] - $b[$field];
            });
            if ($desc) {
                $this->models = array_reverse($this->models);
            }
        }
        return $this;
    }
public function order($field, $desc = false)
    {
        if(count($this->models) > 0) {
            $instance = $this->reflection->newInstance();
            $string = $instance->isString($field);
            usort($this->models, function ($a, $b) use ($field, $string) {
                if($string) {
                    return strcmp($a[$field], $b[$field]);
                }
                return $a[$field] - $b[$field];
            });
            if ($desc) {
                $this->models = array_reverse($this->models);
            }
        }
        return $this;
    }
public function order ( $ field , $ desc = false ) { if ( count ( $ this -> models ) > 0 ) { $ instance = $ this -> reflection -> newInstance ( ) ; $ string = $ instance -> isString ( $ field ) ; usort ( $ this -> models , function ( $ a , $ b ) use ( $ field , $ string ) { if ( $ string ) { return strcmp ( $ a [ $ field ] , $ b [ $ field ] ) ; } return $ a [ $ field ] - $ b [ $ field ] ; } ) ; if ( $ desc ) { $ this -> models = array_reverse ( $ this -> models ) ; } } return $ this ; }
Ordena de menor a mayor en funcion del campo indicado

@param $field
@param bool $desc
@return $this
Ordena de menor a mayor en funcion del campo indicado