leftOperand = $leftOperand; $this->setOperator($operator); $this->setRightOperand($rightOperand); } /** * Sets the expression operator. * * @param string $operator The operator */ public function setOperator($operator) { $this->operator = $operator; } /** * Sets the right operand. * * @param $rightOperand */ public function setRightOperand($rightOperand) { $this->rightOperand = $rightOperand; } /** * Serializes to string. * * @return string */ public function __toString() { return ArrayUtils::implodeFiltered( self::EXPRESSION_DELIMITER, [$this->leftOperand, $this->operator, $this->rightOperand] ); } /** * Serializes to json. * * @return mixed */ public function jsonSerialize() { return [ 'left_operand' => $this->leftOperand, 'operator' => $this->operator, 'right_operand' => $this->rightOperand, ]; } }