_operator = $operator; $this->_value = $value; $this->position = $position; } /** * @inheritDoc */ public function sql(ValueBinder $binder): string { $operand = $this->_value; if ($operand instanceof ExpressionInterface) { $operand = $operand->sql($binder); } if ($this->position === self::POSTFIX) { return '(' . $operand . ') ' . $this->_operator; } return $this->_operator . ' (' . $operand . ')'; } /** * @inheritDoc */ public function traverse(Closure $callback) { if ($this->_value instanceof ExpressionInterface) { $callback($this->_value); $this->_value->traverse($callback); } return $this; } /** * Perform a deep clone of the inner expression. * * @return void */ public function __clone() { if ($this->_value instanceof ExpressionInterface) { $this->_value = clone $this->_value; } } }