private function addExpression($part, $type, $expression)
    {
        if (!($expression instanceof Expression\Expression)) {
            $expression = new Expression\Expression($type, (array) $expression);
        }

        if ($this->parts[$part] === null) {
            $this->parts[$part] = $expression;

            return $this;
        }

        if ($this->parts[$part]->getType() !== $type) {
            $this->parts[$part] = new Expression\Expression($type, array($this->parts[$part]));
        }

        foreach ($expression->getParts() as $expressionPart) {
            $this->parts[$part]->addPart($expressionPart);
        }

        return $this;
    }
private function addExpression($part, $type, $expression)
    {
        if (!($expression instanceof Expression\Expression)) {
            $expression = new Expression\Expression($type, (array) $expression);
        }

        if ($this->parts[$part] === null) {
            $this->parts[$part] = $expression;

            return $this;
        }

        if ($this->parts[$part]->getType() !== $type) {
            $this->parts[$part] = new Expression\Expression($type, array($this->parts[$part]));
        }

        foreach ($expression->getParts() as $expressionPart) {
            $this->parts[$part]->addPart($expressionPart);
        }

        return $this;
    }
private function addExpression ( $ part , $ type , $ expression ) { if ( ! ( $ expression instanceof Expression \ Expression ) ) { $ expression = new Expression \ Expression ( $ type , ( array ) $ expression ) ; } if ( $ this -> parts [ $ part ] === null ) { $ this -> parts [ $ part ] = $ expression ; return $ this ; } if ( $ this -> parts [ $ part ] -> getType ( ) !== $ type ) { $ this -> parts [ $ part ] = new Expression \ Expression ( $ type , array ( $ this -> parts [ $ part ] ) ) ; } foreach ( $ expression -> getParts ( ) as $ expressionPart ) { $ this -> parts [ $ part ] -> addPart ( $ expressionPart ) ; } return $ this ; }
Adds an expression to the "WHERE" or "HAVING" clause.

@param string                                                $part       The query part.
@param string                                                $type       The expression type (AND, OR)
@param string|array|\Fridge\DBAL\Query\Expression\Expression $expression The expression.

@return \Fridge\DBAL\Query\QueryBuilder The query builder.
Adds an expression to the WHERE or HAVING clause .