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