/** * @return int|null */ public function getAmountForSerialization() { if ($this->amount instanceof MoneyInterface) { return $this->amount->getValueWithoutSeparation(2); } return $this->amount; }
/** * @return int */ public function getUnitPriceForSerialization() { return $this->unitPrice->getValueWithoutSeparation(2); }
/** * @param MoneyInterface $money * * @return MoneyInterface */ public function add(MoneyInterface $money) { return new self((double) ($this->getValue() + $money->getValue()), $this->currency, $this->precision); }
/** * @return int */ public function getTotalAmountForSerialization() { return $this->totalAmount->getValueWithoutSeparation(2); }