protected function OptimizeBinaryOperationExpression(BinaryOperationExpression $Expression) { $LeftOperand = $Expression->GetLeftOperandExpression(); $RightOperand = $Expression->GetRightOperandExpression(); if ($LeftOperand instanceof ReviveColumnExpression && $this->IsExpressionConstant($RightOperand)) { $this->OptimizeReviveColumnCompareConstantExpression($LeftOperand, $RightOperand); } else { if ($RightOperand instanceof ReviveColumnExpression && $this->IsExpressionConstant($LeftOperand)) { $this->OptimizeReviveColumnCompareConstantExpression($RightOperand, $LeftOperand); } else { return $Expression; } } return Expression::BinaryOperation($LeftOperand, $Expression->GetOperator(), $RightOperand); }
protected function AppendBinaryOperation(QueryBuilder $QueryBuilder, E\BinaryOperationExpression $Expression) { $this->Append($QueryBuilder, $Expression->GetLeftOperandExpression()); $QueryBuilder->Append($this->GetBinaryOperatorString($Expression->GetOperator())); $this->Append($QueryBuilder, $Expression->GetRightOperandExpression()); }