1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | use Worldline\Connect\Sdk\Domain\DataObject; |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | class Level3SummaryData extends DataObject |
16: | { |
17: | |
18: | |
19: | |
20: | |
21: | public $discountAmount = null; |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | public $dutyAmount = null; |
28: | |
29: | |
30: | |
31: | |
32: | |
33: | public $shippingAmount = null; |
34: | |
35: | |
36: | |
37: | |
38: | public function toObject() |
39: | { |
40: | $object = parent::toObject(); |
41: | if (!is_null($this->discountAmount)) { |
42: | $object->discountAmount = $this->discountAmount; |
43: | } |
44: | if (!is_null($this->dutyAmount)) { |
45: | $object->dutyAmount = $this->dutyAmount; |
46: | } |
47: | if (!is_null($this->shippingAmount)) { |
48: | $object->shippingAmount = $this->shippingAmount; |
49: | } |
50: | return $object; |
51: | } |
52: | |
53: | |
54: | |
55: | |
56: | |
57: | |
58: | public function fromObject($object) |
59: | { |
60: | parent::fromObject($object); |
61: | if (property_exists($object, 'discountAmount')) { |
62: | $this->discountAmount = $object->discountAmount; |
63: | } |
64: | if (property_exists($object, 'dutyAmount')) { |
65: | $this->dutyAmount = $object->dutyAmount; |
66: | } |
67: | if (property_exists($object, 'shippingAmount')) { |
68: | $this->shippingAmount = $object->shippingAmount; |
69: | } |
70: | return $this; |
71: | } |
72: | } |
73: | |