commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
DeliveryItemsUpdatedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
22 {
23  public const DISCRIMINATOR_VALUE = 'DeliveryItemsUpdated';
28  protected $type;
29 
34  protected $deliveryId;
35 
40  protected $items;
41 
46  protected $oldItems;
47 
52  protected $shippingKey;
53 
54 
58  public function __construct(
59  ?string $deliveryId = null,
62  ?string $shippingKey = null,
63  ?string $type = null
64  ) {
65  $this->deliveryId = $deliveryId;
66  $this->items = $items;
67  $this->oldItems = $oldItems;
68  $this->shippingKey = $shippingKey;
69  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
70  }
71 
76  public function getType()
77  {
78  if (is_null($this->type)) {
80  $data = $this->raw(self::FIELD_TYPE);
81  if (is_null($data)) {
82  return null;
83  }
84  $this->type = (string) $data;
85  }
86 
87  return $this->type;
88  }
89 
96  public function getDeliveryId()
97  {
98  if (is_null($this->deliveryId)) {
100  $data = $this->raw(self::FIELD_DELIVERY_ID);
101  if (is_null($data)) {
102  return null;
103  }
104  $this->deliveryId = (string) $data;
105  }
106 
107  return $this->deliveryId;
108  }
109 
116  public function getItems()
117  {
118  if (is_null($this->items)) {
120  $data = $this->raw(self::FIELD_ITEMS);
121  if (is_null($data)) {
122  return null;
123  }
124  $this->items = DeliveryItemCollection::fromArray($data);
125  }
126 
127  return $this->items;
128  }
129 
136  public function getOldItems()
137  {
138  if (is_null($this->oldItems)) {
140  $data = $this->raw(self::FIELD_OLD_ITEMS);
141  if (is_null($data)) {
142  return null;
143  }
144  $this->oldItems = DeliveryItemCollection::fromArray($data);
145  }
146 
147  return $this->oldItems;
148  }
149 
156  public function getShippingKey()
157  {
158  if (is_null($this->shippingKey)) {
160  $data = $this->raw(self::FIELD_SHIPPING_KEY);
161  if (is_null($data)) {
162  return null;
163  }
164  $this->shippingKey = (string) $data;
165  }
166 
167  return $this->shippingKey;
168  }
169 
170 
174  public function setDeliveryId(?string $deliveryId): void
175  {
176  $this->deliveryId = $deliveryId;
177  }
178 
182  public function setItems(?DeliveryItemCollection $items): void
183  {
184  $this->items = $items;
185  }
186 
191  {
192  $this->oldItems = $oldItems;
193  }
194 
198  public function setShippingKey(?string $shippingKey): void
199  {
200  $this->shippingKey = $shippingKey;
201  }
202 }
__construct(?string $deliveryId=null, ?DeliveryItemCollection $items=null, ?DeliveryItemCollection $oldItems=null, ?string $shippingKey=null, ?string $type=null)