commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
OrderFieldModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class OrderFieldModel extends JsonObjectModel implements OrderField
21 {
26  protected $addReturnInfo;
27 
33 
38  protected $addDeliveries;
39 
44  protected $removeDelivery;
45 
51 
57 
63 
69 
74  protected $setParcelItems;
75 
76 
80  public function __construct(
81  ?ReturnInfo $addReturnInfo = null,
90  ) {
91  $this->addReturnInfo = $addReturnInfo;
92  $this->addParcelToDelivery = $addParcelToDelivery;
93  $this->addDeliveries = $addDeliveries;
94  $this->removeDelivery = $removeDelivery;
95  $this->removeParcelFromDelivery = $removeParcelFromDelivery;
96  $this->setDeliveryAddress = $setDeliveryAddress;
97  $this->setParcelMeasurements = $setParcelMeasurements;
98  $this->setParcelTrackingData = $setParcelTrackingData;
99  $this->setParcelItems = $setParcelItems;
100  }
101 
108  public function getAddReturnInfo()
109  {
110  if (is_null($this->addReturnInfo)) {
112  $data = $this->raw(self::FIELD_ADD_RETURN_INFO);
113  if (is_null($data)) {
114  return null;
115  }
116 
117  $this->addReturnInfo = ReturnInfoModel::of($data);
118  }
119 
120  return $this->addReturnInfo;
121  }
122 
129  public function getAddParcelToDelivery()
130  {
131  if (is_null($this->addParcelToDelivery)) {
133  $data = $this->raw(self::FIELD_ADD_PARCEL_TO_DELIVERY);
134  if (is_null($data)) {
135  return null;
136  }
137 
138  $this->addParcelToDelivery = DeliveryParcelModel::of($data);
139  }
140 
142  }
143 
150  public function getAddDeliveries()
151  {
152  if (is_null($this->addDeliveries)) {
154  $data = $this->raw(self::FIELD_ADD_DELIVERIES);
155  if (is_null($data)) {
156  return null;
157  }
158  $this->addDeliveries = DeliveryDraftCollection::fromArray($data);
159  }
160 
161  return $this->addDeliveries;
162  }
163 
170  public function getRemoveDelivery()
171  {
172  if (is_null($this->removeDelivery)) {
174  $data = $this->raw(self::FIELD_REMOVE_DELIVERY);
175  if (is_null($data)) {
176  return null;
177  }
178 
179  $this->removeDelivery = RemoveDeliveryDraftModel::of($data);
180  }
181 
182  return $this->removeDelivery;
183  }
184 
191  public function getRemoveParcelFromDelivery()
192  {
193  if (is_null($this->removeParcelFromDelivery)) {
195  $data = $this->raw(self::FIELD_REMOVE_PARCEL_FROM_DELIVERY);
196  if (is_null($data)) {
197  return null;
198  }
199 
200  $this->removeParcelFromDelivery = RemoveParcelFromDeliveryDraftModel::of($data);
201  }
202 
204  }
205 
212  public function getSetDeliveryAddress()
213  {
214  if (is_null($this->setDeliveryAddress)) {
216  $data = $this->raw(self::FIELD_SET_DELIVERY_ADDRESS);
217  if (is_null($data)) {
218  return null;
219  }
220 
221  $this->setDeliveryAddress = DeliveryAddressDraftModel::of($data);
222  }
223 
225  }
226 
233  public function getSetParcelMeasurements()
234  {
235  if (is_null($this->setParcelMeasurements)) {
237  $data = $this->raw(self::FIELD_SET_PARCEL_MEASUREMENTS);
238  if (is_null($data)) {
239  return null;
240  }
241 
242  $this->setParcelMeasurements = ParcelMeasurementDraftModel::of($data);
243  }
244 
246  }
247 
254  public function getSetParcelTrackingData()
255  {
256  if (is_null($this->setParcelTrackingData)) {
258  $data = $this->raw(self::FIELD_SET_PARCEL_TRACKING_DATA);
259  if (is_null($data)) {
260  return null;
261  }
262 
263  $this->setParcelTrackingData = ParcelTrackingDataModel::of($data);
264  }
265 
267  }
268 
275  public function getSetParcelItems()
276  {
277  if (is_null($this->setParcelItems)) {
279  $data = $this->raw(self::FIELD_SET_PARCEL_ITEMS);
280  if (is_null($data)) {
281  return null;
282  }
283  $this->setParcelItems = ParcelItemsCollection::fromArray($data);
284  }
285 
286  return $this->setParcelItems;
287  }
288 
289 
294  {
295  $this->addReturnInfo = $addReturnInfo;
296  }
297 
302  {
303  $this->addParcelToDelivery = $addParcelToDelivery;
304  }
305 
310  {
311  $this->addDeliveries = $addDeliveries;
312  }
313 
318  {
319  $this->removeDelivery = $removeDelivery;
320  }
321 
326  {
327  $this->removeParcelFromDelivery = $removeParcelFromDelivery;
328  }
329 
334  {
335  $this->setDeliveryAddress = $setDeliveryAddress;
336  }
337 
342  {
343  $this->setParcelMeasurements = $setParcelMeasurements;
344  }
345 
350  {
351  $this->setParcelTrackingData = $setParcelTrackingData;
352  }
353 
358  {
359  $this->setParcelItems = $setParcelItems;
360  }
361 }
setSetParcelTrackingData(?ParcelTrackingData $setParcelTrackingData)
setSetDeliveryAddress(?DeliveryAddressDraft $setDeliveryAddress)
setSetParcelItems(?ParcelItemsCollection $setParcelItems)
__construct(?ReturnInfo $addReturnInfo=null, ?DeliveryParcel $addParcelToDelivery=null, ?DeliveryDraftCollection $addDeliveries=null, ?RemoveDeliveryDraft $removeDelivery=null, ?RemoveParcelFromDeliveryDraft $removeParcelFromDelivery=null, ?DeliveryAddressDraft $setDeliveryAddress=null, ?ParcelMeasurementDraft $setParcelMeasurements=null, ?ParcelTrackingData $setParcelTrackingData=null, ?ParcelItemsCollection $setParcelItems=null)
setSetParcelMeasurements(?ParcelMeasurementDraft $setParcelMeasurements)
setRemoveParcelFromDelivery(?RemoveParcelFromDeliveryDraft $removeParcelFromDelivery)
setAddDeliveries(?DeliveryDraftCollection $addDeliveries)
setRemoveDelivery(?RemoveDeliveryDraft $removeDelivery)
setAddParcelToDelivery(?DeliveryParcel $addParcelToDelivery)