commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetAssetCustomFieldChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'SetAssetCustomFieldChange';
30 protected $type;
31
36 protected $change;
37
42 protected $previousValue;
43
48 protected $nextValue;
49
54 protected $name;
55
60 protected $customTypeId;
61
66 protected $asset;
67
72 protected $catalogData;
73
78 protected $variant;
79
80
84 public function __construct(
85 ?string $change = null,
86 $previousValue = null,
87 $nextValue = null,
88 ?string $name = null,
89 ?string $customTypeId = null,
91 ?string $catalogData = null,
92 ?string $variant = null,
93 ?string $type = null
94 ) {
95 $this->change = $change;
96 $this->previousValue = $previousValue;
97 $this->nextValue = $nextValue;
98 $this->name = $name;
99 $this->customTypeId = $customTypeId;
100 $this->asset = $asset;
101 $this->catalogData = $catalogData;
102 $this->variant = $variant;
103 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
104 }
105
110 public function getType()
111 {
112 if (is_null($this->type)) {
114 $data = $this->raw(self::FIELD_TYPE);
115 if (is_null($data)) {
116 return null;
117 }
118 $this->type = (string) $data;
119 }
120
121 return $this->type;
122 }
123
128 public function getChange()
129 {
130 if (is_null($this->change)) {
132 $data = $this->raw(self::FIELD_CHANGE);
133 if (is_null($data)) {
134 return null;
135 }
136 $this->change = (string) $data;
137 }
138
139 return $this->change;
140 }
141
148 public function getPreviousValue()
149 {
150 if (is_null($this->previousValue)) {
152 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
153 if (is_null($data)) {
154 return null;
155 }
156 $this->previousValue = $data;
157 }
158
160 }
161
168 public function getNextValue()
169 {
170 if (is_null($this->nextValue)) {
172 $data = $this->raw(self::FIELD_NEXT_VALUE);
173 if (is_null($data)) {
174 return null;
175 }
176 $this->nextValue = $data;
177 }
178
179 return $this->nextValue;
180 }
181
188 public function getName()
189 {
190 if (is_null($this->name)) {
192 $data = $this->raw(self::FIELD_NAME);
193 if (is_null($data)) {
194 return null;
195 }
196 $this->name = (string) $data;
197 }
198
199 return $this->name;
200 }
201
208 public function getCustomTypeId()
209 {
210 if (is_null($this->customTypeId)) {
212 $data = $this->raw(self::FIELD_CUSTOM_TYPE_ID);
213 if (is_null($data)) {
214 return null;
215 }
216 $this->customTypeId = (string) $data;
217 }
218
219 return $this->customTypeId;
220 }
221
228 public function getAsset()
229 {
230 if (is_null($this->asset)) {
232 $data = $this->raw(self::FIELD_ASSET);
233 if (is_null($data)) {
234 return null;
235 }
236
237 $this->asset = AssetChangeValueModel::of($data);
238 }
239
240 return $this->asset;
241 }
242
253 public function getCatalogData()
254 {
255 if (is_null($this->catalogData)) {
257 $data = $this->raw(self::FIELD_CATALOG_DATA);
258 if (is_null($data)) {
259 return null;
260 }
261 $this->catalogData = (string) $data;
262 }
263
264 return $this->catalogData;
265 }
266
274 public function getVariant()
275 {
276 if (is_null($this->variant)) {
278 $data = $this->raw(self::FIELD_VARIANT);
279 if (is_null($data)) {
280 return null;
281 }
282 $this->variant = (string) $data;
283 }
284
285 return $this->variant;
286 }
287
288
292 public function setChange(?string $change): void
293 {
294 $this->change = $change;
295 }
296
300 public function setPreviousValue( $previousValue): void
301 {
302 $this->previousValue = $previousValue;
303 }
304
308 public function setNextValue( $nextValue): void
309 {
310 $this->nextValue = $nextValue;
311 }
312
316 public function setName(?string $name): void
317 {
318 $this->name = $name;
319 }
320
324 public function setCustomTypeId(?string $customTypeId): void
325 {
326 $this->customTypeId = $customTypeId;
327 }
328
332 public function setAsset(?AssetChangeValue $asset): void
333 {
334 $this->asset = $asset;
335 }
336
340 public function setCatalogData(?string $catalogData): void
341 {
342 $this->catalogData = $catalogData;
343 }
344
348 public function setVariant(?string $variant): void
349 {
350 $this->variant = $variant;
351 }
352
353
354
355}
__construct(?string $change=null, $previousValue=null, $nextValue=null, ?string $name=null, ?string $customTypeId=null, ?AssetChangeValue $asset=null, ?string $catalogData=null, ?string $variant=null, ?string $type=null)