") */ public $packages; /** * Данные доставки. * * @var SaveDeliveryData * * @Serializer\Groups({"request"}) * @Serializer\SerializedName("delivery") * @Serializer\Type("RetailCrm\DeliveryModuleBundle\Model\SaveDeliveryData") */ public $delivery; /** * Валюта. * * @var string * * @Serializer\Groups({"request", "calculate"}) * @Serializer\SerializedName("currency") * @Serializer\Type("string") */ public $currency; public function getFullDeclaredValue() { $result = 0; foreach ($this->packages as $package) { foreach ($package->items as $item) { $result += $item->declaredValue * $item->quantity; } } return $result; } public function getFullItemsCodValue() { $result = 0; foreach ($this->packages as $package) { foreach ($package->items as $item) { $result += $item->cod * $item->quantity; } } return $result; } }