src/Driver/Compiler.php
protected function compileOrdering(array $ordering): string
    {
        $result = [];
        foreach ($ordering as $order) {
            $direction = strtoupper($order[1]);

            if (!in_array($direction, ['ASC', 'DESC'])) {
                throw new CompilerException("Invalid sorting direction, only ASC and DESC are allowed");
            }

            $result[] = $this->quote($order[0]) . ' ' . $direction;
        }

        return implode(', ', $result);
    }
protected function compileOrdering(array $ordering): string
    {
        $result = [];
        foreach ($ordering as $order) {
            $direction = strtoupper($order[1]);

            if (!in_array($direction, ['ASC', 'DESC'])) {
                throw new CompilerException("Invalid sorting direction, only ASC and DESC are allowed");
            }

            $result[] = $this->quote($order[0]) . ' ' . $direction;
        }

        return implode(', ', $result);
    }
protected function compileOrdering ( array $ ordering ) : string { $ result = [ ] ; foreach ( $ ordering as $ order ) { $ direction = strtoupper ( $ order [ 1 ] ) ; if ( ! in_array ( $ direction , [ 'ASC' , 'DESC' ] ) ) { throw new CompilerException ( "Invalid sorting direction, only ASC and DESC are allowed" ) ; } $ result [ ] = $ this -> quote ( $ order [ 0 ] ) . ' ' . $ direction ; } return implode ( ', ' , $ result ) ; }
Compile ORDER BY statement.

@param array $ordering

@return string
Compile ORDER BY statement .