src/Norm/Cursor.php
public function sort(array $sorts = array())
    {
        if (func_num_args() === 0) {
            return $this->sorts;
        }

        $this->sorts = array();

        foreach ($sorts as $key => $value) {
            if ($key[0] === '$') {
                $key[0] = '_';
            }

            $this->sorts[$key] = $value;
        }

        return $this;
    }
public function sort(array $sorts = array())
    {
        if (func_num_args() === 0) {
            return $this->sorts;
        }

        $this->sorts = array();

        foreach ($sorts as $key => $value) {
            if ($key[0] === '$') {
                $key[0] = '_';
            }

            $this->sorts[$key] = $value;
        }

        return $this;
    }
public function sort ( array $ sorts = array ( ) ) { if ( func_num_args ( ) === 0 ) { return $ this -> sorts ; } $ this -> sorts = array ( ) ; foreach ( $ sorts as $ key => $ value ) { if ( $ key [ 0 ] === '$' ) { $ key [ 0 ] = '_' ; } $ this -> sorts [ $ key ] = $ value ; } return $ this ; }
When argument specified will set new sorts otherwise will return existing sorts

@param array $sorts

@return mixed When argument specified will return sorts otherwise return chainable object
When argument specified will set new sorts otherwise will return existing sorts