protected function buildOrderBy()
    {
        if (count($this->orderBy) === 0) {
            return '';
        }

        $orders = [];
        foreach ($this->orderBy as $orderBy) {
            $key = $this->quoteIdentifier($orderBy['tableName']) . '.' . $this->quoteIdentifier($orderBy['key']);
            $orders[] = $key . ' ' . $orderBy['direction'];
        }
        return 'ORDER BY ' . implode(', ', $orders);
    }
protected function buildOrderBy()
    {
        if (count($this->orderBy) === 0) {
            return '';
        }

        $orders = [];
        foreach ($this->orderBy as $orderBy) {
            $key = $this->quoteIdentifier($orderBy['tableName']) . '.' . $this->quoteIdentifier($orderBy['key']);
            $orders[] = $key . ' ' . $orderBy['direction'];
        }
        return 'ORDER BY ' . implode(', ', $orders);
    }
protected function buildOrderBy ( ) { if ( count ( $ this -> orderBy ) === 0 ) { return '' ; } $ orders = [ ] ; foreach ( $ this -> orderBy as $ orderBy ) { $ key = $ this -> quoteIdentifier ( $ orderBy [ 'tableName' ] ) . '.' . $ this -> quoteIdentifier ( $ orderBy [ 'key' ] ) ; $ orders [ ] = $ key . ' ' . $ orderBy [ 'direction' ] ; } return 'ORDER BY ' . implode ( ', ' , $ orders ) ; }
Build and return the order by string.

@return string
Build and return the order by string .