src/ORM/Connect/DBQueryBuilder.php
public function buildOrderByFragment(SQLSelect $query, array &$parameters)
    {
        $orderBy = $query->getOrderBy();
        if (empty($orderBy)) {
            return '';
        }

        // Build orders, each with direction considered
        $statements = array();
        foreach ($orderBy as $clause => $dir) {
            $statements[] = trim("$clause $dir");
        }

        $nl = $this->getSeparator();
        return "{$nl}ORDER BY " . implode(', ', $statements);
    }
public function buildOrderByFragment(SQLSelect $query, array &$parameters)
    {
        $orderBy = $query->getOrderBy();
        if (empty($orderBy)) {
            return '';
        }

        // Build orders, each with direction considered
        $statements = array();
        foreach ($orderBy as $clause => $dir) {
            $statements[] = trim("$clause $dir");
        }

        $nl = $this->getSeparator();
        return "{$nl}ORDER BY " . implode(', ', $statements);
    }
public function buildOrderByFragment ( SQLSelect $ query , array & $ parameters ) { $ orderBy = $ query -> getOrderBy ( ) ; if ( empty ( $ orderBy ) ) { return '' ; } // Build orders, each with direction considered $ statements = array ( ) ; foreach ( $ orderBy as $ clause => $ dir ) { $ statements [ ] = trim ( "$clause $dir" ) ; } $ nl = $ this -> getSeparator ( ) ; return "{$nl}ORDER BY " . implode ( ', ' , $ statements ) ; }
Returns the ORDER BY clauses ready for inserting into a query.

@param SQLSelect $query The expression object to build from
@param array $parameters Out parameter for the resulting query parameters
@return string Completed order by part of statement
Returns the ORDER BY clauses ready for inserting into a query .