src/ORM/Queries/SQLSelect.php
public function getOrderBy()
    {
        $orderby = $this->orderby;
        if (!$orderby) {
            $orderby = array();
        }

        if (!is_array($orderby)) {
            // spilt by any commas not within brackets
            $orderby = preg_split('/,(?![^()]*+\\))/', $orderby);
        }

        foreach ($orderby as $k => $v) {
            if (strpos($v, ' ') !== false) {
                unset($orderby[$k]);

                $rule = explode(' ', trim($v));
                $clause = $rule[0];
                $dir = (isset($rule[1])) ? $rule[1] : 'ASC';

                $orderby[$clause] = $dir;
            }
        }

        return $orderby;
    }
public function getOrderBy()
    {
        $orderby = $this->orderby;
        if (!$orderby) {
            $orderby = array();
        }

        if (!is_array($orderby)) {
            // spilt by any commas not within brackets
            $orderby = preg_split('/,(?![^()]*+\\))/', $orderby);
        }

        foreach ($orderby as $k => $v) {
            if (strpos($v, ' ') !== false) {
                unset($orderby[$k]);

                $rule = explode(' ', trim($v));
                $clause = $rule[0];
                $dir = (isset($rule[1])) ? $rule[1] : 'ASC';

                $orderby[$clause] = $dir;
            }
        }

        return $orderby;
    }
public function getOrderBy ( ) { $ orderby = $ this -> orderby ; if ( ! $ orderby ) { $ orderby = array ( ) ; } if ( ! is_array ( $ orderby ) ) { // spilt by any commas not within brackets $ orderby = preg_split ( '/,(?![^()]*+\\))/' , $ orderby ) ; } foreach ( $ orderby as $ k => $ v ) { if ( strpos ( $ v , ' ' ) !== false ) { unset ( $ orderby [ $ k ] ) ; $ rule = explode ( ' ' , trim ( $ v ) ) ; $ clause = $ rule [ 0 ] ; $ dir = ( isset ( $ rule [ 1 ] ) ) ? $ rule [ 1 ] : 'ASC' ; $ orderby [ $ clause ] = $ dir ; } } return $ orderby ; }
Returns the current order by as array if not already. To handle legacy
statements which are stored as strings. Without clauses and directions,
convert the orderby clause to something readable.

@return array
Returns the current order by as array if not already . To handle legacy statements which are stored as strings . Without clauses and directions convert the orderby clause to something readable .