commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetPricesChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
17
22{
23
24 public const DISCRIMINATOR_VALUE = 'SetPricesChange';
29 protected $type;
30
35 protected $change;
36
41 protected $previousValue;
42
47 protected $nextValue;
48
53 protected $catalogData;
54
59 protected $variant;
60
65 protected $addedItems;
66
71 protected $removedItems;
72
73
77 public function __construct(
78 ?string $change = null,
81 ?string $catalogData = null,
82 ?string $variant = null,
85 ?string $type = null
86 ) {
87 $this->change = $change;
88 $this->previousValue = $previousValue;
89 $this->nextValue = $nextValue;
90 $this->catalogData = $catalogData;
91 $this->variant = $variant;
92 $this->addedItems = $addedItems;
93 $this->removedItems = $removedItems;
94 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
95 }
96
101 public function getType()
102 {
103 if (is_null($this->type)) {
105 $data = $this->raw(self::FIELD_TYPE);
106 if (is_null($data)) {
107 return null;
108 }
109 $this->type = (string) $data;
110 }
111
112 return $this->type;
113 }
114
119 public function getChange()
120 {
121 if (is_null($this->change)) {
123 $data = $this->raw(self::FIELD_CHANGE);
124 if (is_null($data)) {
125 return null;
126 }
127 $this->change = (string) $data;
128 }
129
130 return $this->change;
131 }
132
139 public function getPreviousValue()
140 {
141 if (is_null($this->previousValue)) {
143 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
144 if (is_null($data)) {
145 return null;
146 }
147 $this->previousValue = PriceCollection::fromArray($data);
148 }
149
151 }
152
159 public function getNextValue()
160 {
161 if (is_null($this->nextValue)) {
163 $data = $this->raw(self::FIELD_NEXT_VALUE);
164 if (is_null($data)) {
165 return null;
166 }
167 $this->nextValue = PriceCollection::fromArray($data);
168 }
169
170 return $this->nextValue;
171 }
172
183 public function getCatalogData()
184 {
185 if (is_null($this->catalogData)) {
187 $data = $this->raw(self::FIELD_CATALOG_DATA);
188 if (is_null($data)) {
189 return null;
190 }
191 $this->catalogData = (string) $data;
192 }
193
194 return $this->catalogData;
195 }
196
204 public function getVariant()
205 {
206 if (is_null($this->variant)) {
208 $data = $this->raw(self::FIELD_VARIANT);
209 if (is_null($data)) {
210 return null;
211 }
212 $this->variant = (string) $data;
213 }
214
215 return $this->variant;
216 }
217
224 public function getAddedItems()
225 {
226 if (is_null($this->addedItems)) {
228 $data = $this->raw(self::FIELD_ADDED_ITEMS);
229 if (is_null($data)) {
230 return null;
231 }
232 $this->addedItems = PriceCollection::fromArray($data);
233 }
234
235 return $this->addedItems;
236 }
237
244 public function getRemovedItems()
245 {
246 if (is_null($this->removedItems)) {
248 $data = $this->raw(self::FIELD_REMOVED_ITEMS);
249 if (is_null($data)) {
250 return null;
251 }
252 $this->removedItems = PriceCollection::fromArray($data);
253 }
254
255 return $this->removedItems;
256 }
257
258
262 public function setChange(?string $change): void
263 {
264 $this->change = $change;
265 }
266
271 {
272 $this->previousValue = $previousValue;
273 }
274
279 {
280 $this->nextValue = $nextValue;
281 }
282
286 public function setCatalogData(?string $catalogData): void
287 {
288 $this->catalogData = $catalogData;
289 }
290
294 public function setVariant(?string $variant): void
295 {
296 $this->variant = $variant;
297 }
298
303 {
304 $this->addedItems = $addedItems;
305 }
306
311 {
312 $this->removedItems = $removedItems;
313 }
314
315
316
317}
__construct(?string $change=null, ?PriceCollection $previousValue=null, ?PriceCollection $nextValue=null, ?string $catalogData=null, ?string $variant=null, ?PriceCollection $addedItems=null, ?PriceCollection $removedItems=null, ?string $type=null)