protected function orderByDirection($field, $direction, $prefixWithTableAlias = true)
    {
        $aliasInsert = $prefixWithTableAlias ? '?f:alias:.' : '';

        if ($this->orderSql == '') {
            $this->orderSql = " ORDER BY {$aliasInsert}?f {$direction}";
        } else {
            $this->orderSql .= ", {$aliasInsert}?f {$direction}";
        }
        $this->orderArguments[] = $field;
    }