_operator = $operator; $this->_value = $value; $this->_mode = $mode; } /** * Converts the expression to its string representation * * @param \Cake\Database\ValueBinder $generator Placeholder generator object * @return string */ public function sql(ValueBinder $generator) { $operand = $this->_value; if ($operand instanceof ExpressionInterface) { $operand = $operand->sql($generator); } if ($this->_mode === self::POSTFIX) { return '(' . $operand . ') ' . $this->_operator; } return $this->_operator . ' (' . $operand . ')'; } /** * {@inheritDoc} * */ public function traverse(callable $callable) { if ($this->_value instanceof ExpressionInterface) { $callable($this->_value); $this->_value->traverse($callable); } } /** * Perform a deep clone of the inner expression. * * @return void */ public function __clone() { if ($this->_value instanceof ExpressionInterface) { $this->_value = clone $this->_value; } } }