commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ParcelItemsUpdatedMessagePayloadModel.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
22{
23 public const DISCRIMINATOR_VALUE = 'ParcelItemsUpdated';
28 protected $type;
29
34 protected $parcelId;
35
40 protected $deliveryId;
41
46 protected $items;
47
52 protected $oldItems;
53
58 protected $shippingKey;
59
60
64 public function __construct(
65 ?string $parcelId = null,
66 ?string $deliveryId = null,
69 ?string $shippingKey = null,
70 ?string $type = null
71 ) {
72 $this->parcelId = $parcelId;
73 $this->deliveryId = $deliveryId;
74 $this->items = $items;
75 $this->oldItems = $oldItems;
76 $this->shippingKey = $shippingKey;
77 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
78 }
79
84 public function getType()
85 {
86 if (is_null($this->type)) {
88 $data = $this->raw(self::FIELD_TYPE);
89 if (is_null($data)) {
90 return null;
91 }
92 $this->type = (string) $data;
93 }
94
95 return $this->type;
96 }
97
104 public function getParcelId()
105 {
106 if (is_null($this->parcelId)) {
108 $data = $this->raw(self::FIELD_PARCEL_ID);
109 if (is_null($data)) {
110 return null;
111 }
112 $this->parcelId = (string) $data;
113 }
114
115 return $this->parcelId;
116 }
117
124 public function getDeliveryId()
125 {
126 if (is_null($this->deliveryId)) {
128 $data = $this->raw(self::FIELD_DELIVERY_ID);
129 if (is_null($data)) {
130 return null;
131 }
132 $this->deliveryId = (string) $data;
133 }
134
135 return $this->deliveryId;
136 }
137
144 public function getItems()
145 {
146 if (is_null($this->items)) {
148 $data = $this->raw(self::FIELD_ITEMS);
149 if (is_null($data)) {
150 return null;
151 }
152 $this->items = DeliveryItemCollection::fromArray($data);
153 }
154
155 return $this->items;
156 }
157
164 public function getOldItems()
165 {
166 if (is_null($this->oldItems)) {
168 $data = $this->raw(self::FIELD_OLD_ITEMS);
169 if (is_null($data)) {
170 return null;
171 }
172 $this->oldItems = DeliveryItemCollection::fromArray($data);
173 }
174
175 return $this->oldItems;
176 }
177
184 public function getShippingKey()
185 {
186 if (is_null($this->shippingKey)) {
188 $data = $this->raw(self::FIELD_SHIPPING_KEY);
189 if (is_null($data)) {
190 return null;
191 }
192 $this->shippingKey = (string) $data;
193 }
194
195 return $this->shippingKey;
196 }
197
198
202 public function setParcelId(?string $parcelId): void
203 {
204 $this->parcelId = $parcelId;
205 }
206
210 public function setDeliveryId(?string $deliveryId): void
211 {
212 $this->deliveryId = $deliveryId;
213 }
214
218 public function setItems(?DeliveryItemCollection $items): void
219 {
220 $this->items = $items;
221 }
222
227 {
228 $this->oldItems = $oldItems;
229 }
230
234 public function setShippingKey(?string $shippingKey): void
235 {
236 $this->shippingKey = $shippingKey;
237 }
238}
__construct(?string $parcelId=null, ?string $deliveryId=null, ?DeliveryItemCollection $items=null, ?DeliveryItemCollection $oldItems=null, ?string $shippingKey=null, ?string $type=null)