protected function visitBinaryOperation(O\BinaryOperationExpression $expression)
{
$operator = $expression->getOperator();
switch ($operator) {
case Operators\Binary::INEQUALITY:
$this->walk(O\Expression::unaryOperation(Operators\Unary::NOT, $expression->update($expression->getLeftOperand(), Operators\Binary::EQUALITY, $expression->getRightOperand())));
return;
case Operators\Binary::CONCATENATION:
$this->sql .= 'CONCAT(';
$this->walk($expression->getLeftOperand());
$this->sql .= ', ';
$this->walk($expression->getRightOperand());
$this->sql .= ')';
return;
}
if (!isset($this->binaryOperators[$operator])) {
throw new PinqDemoSqlException("Binary operator not supported: {$operator}");
}
$this->sql .= '(';
$this->walk($expression->getLeftOperand());
$this->sql .= ' ';
$this->sql .= $this->binaryOperators[$operator];
$this->sql .= ' ';
$this->walk($expression->getRightOperand());
$this->sql .= ')';
}