commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
DeliveryChangeValueModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
20
25{
26
27
32 protected $items;
33
38 protected $address;
39
44 protected $parcels;
45
46
50 public function __construct(
52 ?Address $address = null,
54 ) {
55 $this->items = $items;
56 $this->address = $address;
57 $this->parcels = $parcels;
58
59 }
60
67 public function getItems()
68 {
69 if (is_null($this->items)) {
71 $data = $this->raw(self::FIELD_ITEMS);
72 if (is_null($data)) {
73 return null;
74 }
75 $this->items = DeliveryItemCollection::fromArray($data);
76 }
77
78 return $this->items;
79 }
80
87 public function getAddress()
88 {
89 if (is_null($this->address)) {
91 $data = $this->raw(self::FIELD_ADDRESS);
92 if (is_null($data)) {
93 return null;
94 }
95
96 $this->address = AddressModel::of($data);
97 }
98
99 return $this->address;
100 }
101
108 public function getParcels()
109 {
110 if (is_null($this->parcels)) {
112 $data = $this->raw(self::FIELD_PARCELS);
113 if (is_null($data)) {
114 return null;
115 }
116 $this->parcels = ParcelCollection::fromArray($data);
117 }
118
119 return $this->parcels;
120 }
121
122
126 public function setItems(?DeliveryItemCollection $items): void
127 {
128 $this->items = $items;
129 }
130
134 public function setAddress(?Address $address): void
135 {
136 $this->address = $address;
137 }
138
142 public function setParcels(?ParcelCollection $parcels): void
143 {
144 $this->parcels = $parcels;
145 }
146
147
148
149}
__construct(?DeliveryItemCollection $items=null, ?Address $address=null, ?ParcelCollection $parcels=null)