@param        $expression
@param string $vector

@return $this
352454
public function setOrderBy($expression, $vector = OrderBy::ASC)
    {
        if (!($expression instanceof Expression)) {
            $expression = new Column($expression);
        }
        
        $this->setExpression($expression)->setVector($vector);
        
        return $this;
    }
2977
public function set($index, $value) : Vector
    {
        $values = $this->_set($index, $value, true);
        $this->setValues($values);
        return $this;
    }
736264
public function addSelectColumn($expression, $alias = null)
    {
        if (!($expression instanceof Expression)) {
            $expression = new Expr\Column($expression);
        }
        
        $expression = $this->completeExpression($expression, $alias);
        
        $this->columns->add($expression->hashCode());
        
        return $this;
    }
215709
public function then($expression) : self
    {
        if (! is_array($this->switchBranch)) {
            throw new BadMethodCallException(static::class . '::then requires a valid case statement (call case() first).');
        }

        $this->switchBranch['then'] = $expression;

        if ($this->currentField) {
            $this->expr[$this->currentField]['$switch']['branches'][] = $this->ensureArray($this->switchBranch);
        } else {
            $this->expr['$switch']['branches'][] = $this->ensureArray($this->switchBranch);
        }

        $this->switchBranch = null;

        return $this;
    }
529575
public function eq($expression1, $expression2) : self
    {
        $this->expr->eq($expression1, $expression2);

        return $this;
    }
841759
public function add(ExpressionContract $expression)
    {
        $this->checkType($expression);
        $this->constraints[$expression->name()] = $expression;
        return $this;
    }
643810
public function add(Expression $expr)
    {
        if(!$expr instanceof OrderExpression) {
            throw new \InvalidArgumentException('OrderClause only accept OrderExpression as its part.');
        }

        // internal Expression has to be an unique by field 
        $this->expressions[$expr->getField()->getName()] = $expr;

        return $this;
    }
1298556
public function onPropertyAccessExpression($expression)
    {
        $parent = $expression;
        $variable = null;
        do {
            $variable = $parent->getResourceProperty()->getName() . self::MEMBER_ACCESS . $variable;
            $parent = $parent->getParent();
        } while ($parent != null);
        $variable = rtrim($variable, self::MEMBER_ACCESS);
        $variable = $this->getIteratorName() . self::MEMBER_ACCESS . $variable;
        return $variable;
    }
1297854
public function orWhere(Expression $expression) : self
    {
        if ($this->expression === null) {
            return $this->where($expression);
        }

        $this->expression = new CompositeExpression(
            CompositeExpression::TYPE_OR,
            [$this->expression, $expression]
        );

        return $this;
    }
304624
public function set( $column, $expression )
    {
        $column = $this->getIdentifier( $column );
        $expression = $this->getIdentifier( $expression );
        $this->values[$column] = $expression;
        return $this;
    }
297210
private function operator($operator, $expression)
    {
        if ($this->currentField) {
            $this->expr[$this->currentField][$operator] = $this->ensureArray($expression);
        } else {
            $this->expr[$operator] = $this->ensureArray($expression);
        }

        return $this;
    }
1176128
public function selectElemMatch($fieldName, $expression)
    {
        if ($expression instanceof Expr) {
            $expression = $expression->getQuery();
        }
        $this->query['select'][$fieldName] = array('$elemMatch' => $expression);
        return $this;
    }
339769
public function passArray(array $expression)
    {
        foreach ($expression['left'] as $item) {
            $usePass = self::DETECT_ARRAY_USE == ($this->detectionFlags & self::DETECT_ARRAY_USE);
            if ($usePass && 'variable' == $item['value']['type']) {
                $this->increaseMutations($item['value']['value']);
            } else {
                $this->passExpression($item['value']);
            }
        }
    }
592493
public function select($expression = '*')
    {
        if (!is_array($expression)) {
            $expression = explode(',', $expression);
        }

        $this->type        = self::TYPE_SELECT;
        $this->expressions = array_merge($this->expressions, array_map(function ($expression, $alias) {
            return is_string($alias) ? "$expression AS $alias" : $expression;
        }, $expression, array_keys($expression)));

        return $this;
    }
1318851
public function addExpression($expression)
    {
        if (!$this->expressions->contains($expression)) {
            $this->expressions[] = $expression;
        }

        return $this;
    }
1098537
public function addOperator($expression)
    {
       $this->query .= '( ' . $this->getDriverEscaper()->reserved('subject') . ' ' . 
               $this->getDriverEscaper()->dbCommand('IN') . 
               $this->operationSeparator .'(' . 
               $this->getDriverEscaper()->dbCommand('SELECT') . ' ' . 
               $this->getDriverEscaper()->dbCommand('DISTINCT') . ' ' . 
               $this->getDriverEscaper()->reserved('subject') . ' ' .
               $this->getDriverEscaper()->dbCommand('FROM') .' ' . 
               $this->getDriverEscaper()->reserved($this->options['table']) . ' ' .
               $this->getDriverEscaper()->dbCommand('WHERE') . 
               $this->operationSeparator . $this->language . 
               $this->operationSeparator .$expression . ')' .
               ')';
       return $this;
    }
504410
public function not($expression) : self
    {
        return $this->operator('$not', $expression instanceof Expr ? $expression->getQuery() : $expression);
    }