commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetDeliveryItemsChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
17 
22 {
23 
24  public const DISCRIMINATOR_VALUE = 'SetDeliveryItemsChange';
29  protected $type;
30 
35  protected $change;
36 
41  protected $previousValue;
42 
47  protected $nextValue;
48 
53  protected $deliveryId;
54 
55 
59  public function __construct(
60  ?string $change = null,
63  ?string $deliveryId = null,
64  ?string $type = null
65  ) {
66  $this->change = $change;
67  $this->previousValue = $previousValue;
68  $this->nextValue = $nextValue;
69  $this->deliveryId = $deliveryId;
70  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
71  }
72 
77  public function getType()
78  {
79  if (is_null($this->type)) {
81  $data = $this->raw(self::FIELD_TYPE);
82  if (is_null($data)) {
83  return null;
84  }
85  $this->type = (string) $data;
86  }
87 
88  return $this->type;
89  }
90 
95  public function getChange()
96  {
97  if (is_null($this->change)) {
99  $data = $this->raw(self::FIELD_CHANGE);
100  if (is_null($data)) {
101  return null;
102  }
103  $this->change = (string) $data;
104  }
105 
106  return $this->change;
107  }
108 
115  public function getPreviousValue()
116  {
117  if (is_null($this->previousValue)) {
119  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
120  if (is_null($data)) {
121  return null;
122  }
123  $this->previousValue = DeliveryItemCollection::fromArray($data);
124  }
125 
126  return $this->previousValue;
127  }
128 
135  public function getNextValue()
136  {
137  if (is_null($this->nextValue)) {
139  $data = $this->raw(self::FIELD_NEXT_VALUE);
140  if (is_null($data)) {
141  return null;
142  }
143  $this->nextValue = DeliveryItemCollection::fromArray($data);
144  }
145 
146  return $this->nextValue;
147  }
148 
155  public function getDeliveryId()
156  {
157  if (is_null($this->deliveryId)) {
159  $data = $this->raw(self::FIELD_DELIVERY_ID);
160  if (is_null($data)) {
161  return null;
162  }
163  $this->deliveryId = (string) $data;
164  }
165 
166  return $this->deliveryId;
167  }
168 
169 
173  public function setChange(?string $change): void
174  {
175  $this->change = $change;
176  }
177 
182  {
183  $this->previousValue = $previousValue;
184  }
185 
190  {
191  $this->nextValue = $nextValue;
192  }
193 
197  public function setDeliveryId(?string $deliveryId): void
198  {
199  $this->deliveryId = $deliveryId;
200  }
201 
202 
203 
204 }
__construct(?string $change=null, ?DeliveryItemCollection $previousValue=null, ?DeliveryItemCollection $nextValue=null, ?string $deliveryId=null, ?string $type=null)