src/ORM/Queries/SQLSelect.php
private function getDirectionFromString($value, $defaultDirection = null)
    {
        if (preg_match('/^(.*)(asc|desc)$/i', $value, $matches)) {
            $column = trim($matches[1]);
            $direction = strtoupper($matches[2]);
        } else {
            $column = $value;
            $direction = $defaultDirection ? $defaultDirection : "ASC";
        }
        return array($column, $direction);
    }
private function getDirectionFromString($value, $defaultDirection = null)
    {
        if (preg_match('/^(.*)(asc|desc)$/i', $value, $matches)) {
            $column = trim($matches[1]);
            $direction = strtoupper($matches[2]);
        } else {
            $column = $value;
            $direction = $defaultDirection ? $defaultDirection : "ASC";
        }
        return array($column, $direction);
    }
private function getDirectionFromString ( $ value , $ defaultDirection = null ) { if ( preg_match ( '/^(.*)(asc|desc)$/i' , $ value , $ matches ) ) { $ column = trim ( $ matches [ 1 ] ) ; $ direction = strtoupper ( $ matches [ 2 ] ) ; } else { $ column = $ value ; $ direction = $ defaultDirection ? $ defaultDirection : "ASC" ; } return array ( $ column , $ direction ) ; }
Extract the direction part of a single-column order by clause.

@param string $value
@param string $defaultDirection
@return array A two element array: array($column, $direction)
Extract the direction part of a single - column order by clause .