commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetParcelItemsChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
19 
24 {
25 
26  public const DISCRIMINATOR_VALUE = 'SetParcelItemsChange';
31  protected $type;
32 
37  protected $change;
38 
43  protected $previousValue;
44 
49  protected $nextValue;
50 
55  protected $parcel;
56 
57 
61  public function __construct(
62  ?string $change = null,
65  ?ParcelChangeValue $parcel = null,
66  ?string $type = null
67  ) {
68  $this->change = $change;
69  $this->previousValue = $previousValue;
70  $this->nextValue = $nextValue;
71  $this->parcel = $parcel;
72  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
73  }
74 
79  public function getType()
80  {
81  if (is_null($this->type)) {
83  $data = $this->raw(self::FIELD_TYPE);
84  if (is_null($data)) {
85  return null;
86  }
87  $this->type = (string) $data;
88  }
89 
90  return $this->type;
91  }
92 
97  public function getChange()
98  {
99  if (is_null($this->change)) {
101  $data = $this->raw(self::FIELD_CHANGE);
102  if (is_null($data)) {
103  return null;
104  }
105  $this->change = (string) $data;
106  }
107 
108  return $this->change;
109  }
110 
117  public function getPreviousValue()
118  {
119  if (is_null($this->previousValue)) {
121  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
122  if (is_null($data)) {
123  return null;
124  }
125  $this->previousValue = DeliveryItemCollection::fromArray($data);
126  }
127 
128  return $this->previousValue;
129  }
130 
137  public function getNextValue()
138  {
139  if (is_null($this->nextValue)) {
141  $data = $this->raw(self::FIELD_NEXT_VALUE);
142  if (is_null($data)) {
143  return null;
144  }
145  $this->nextValue = DeliveryItemCollection::fromArray($data);
146  }
147 
148  return $this->nextValue;
149  }
150 
157  public function getParcel()
158  {
159  if (is_null($this->parcel)) {
161  $data = $this->raw(self::FIELD_PARCEL);
162  if (is_null($data)) {
163  return null;
164  }
165 
166  $this->parcel = ParcelChangeValueModel::of($data);
167  }
168 
169  return $this->parcel;
170  }
171 
172 
176  public function setChange(?string $change): void
177  {
178  $this->change = $change;
179  }
180 
185  {
186  $this->previousValue = $previousValue;
187  }
188 
193  {
194  $this->nextValue = $nextValue;
195  }
196 
200  public function setParcel(?ParcelChangeValue $parcel): void
201  {
202  $this->parcel = $parcel;
203  }
204 
205 
206 
207 }
__construct(?string $change=null, ?DeliveryItemCollection $previousValue=null, ?DeliveryItemCollection $nextValue=null, ?ParcelChangeValue $parcel=null, ?string $type=null)