commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetAssetKeyChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'SetAssetKeyChange';
30 protected $type;
31
36 protected $change;
37
42 protected $previousValue;
43
48 protected $nextValue;
49
54 protected $asset;
55
60 protected $catalogData;
61
66 protected $variant;
67
68
72 public function __construct(
73 ?string $change = null,
74 ?string $previousValue = null,
75 ?string $nextValue = null,
77 ?string $catalogData = null,
78 ?string $variant = null,
79 ?string $type = null
80 ) {
81 $this->change = $change;
82 $this->previousValue = $previousValue;
83 $this->nextValue = $nextValue;
84 $this->asset = $asset;
85 $this->catalogData = $catalogData;
86 $this->variant = $variant;
87 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
88 }
89
94 public function getType()
95 {
96 if (is_null($this->type)) {
98 $data = $this->raw(self::FIELD_TYPE);
99 if (is_null($data)) {
100 return null;
101 }
102 $this->type = (string) $data;
103 }
104
105 return $this->type;
106 }
107
112 public function getChange()
113 {
114 if (is_null($this->change)) {
116 $data = $this->raw(self::FIELD_CHANGE);
117 if (is_null($data)) {
118 return null;
119 }
120 $this->change = (string) $data;
121 }
122
123 return $this->change;
124 }
125
132 public function getPreviousValue()
133 {
134 if (is_null($this->previousValue)) {
136 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
137 if (is_null($data)) {
138 return null;
139 }
140 $this->previousValue = (string) $data;
141 }
142
144 }
145
152 public function getNextValue()
153 {
154 if (is_null($this->nextValue)) {
156 $data = $this->raw(self::FIELD_NEXT_VALUE);
157 if (is_null($data)) {
158 return null;
159 }
160 $this->nextValue = (string) $data;
161 }
162
163 return $this->nextValue;
164 }
165
172 public function getAsset()
173 {
174 if (is_null($this->asset)) {
176 $data = $this->raw(self::FIELD_ASSET);
177 if (is_null($data)) {
178 return null;
179 }
180
181 $this->asset = AssetChangeValueModel::of($data);
182 }
183
184 return $this->asset;
185 }
186
197 public function getCatalogData()
198 {
199 if (is_null($this->catalogData)) {
201 $data = $this->raw(self::FIELD_CATALOG_DATA);
202 if (is_null($data)) {
203 return null;
204 }
205 $this->catalogData = (string) $data;
206 }
207
208 return $this->catalogData;
209 }
210
218 public function getVariant()
219 {
220 if (is_null($this->variant)) {
222 $data = $this->raw(self::FIELD_VARIANT);
223 if (is_null($data)) {
224 return null;
225 }
226 $this->variant = (string) $data;
227 }
228
229 return $this->variant;
230 }
231
232
236 public function setChange(?string $change): void
237 {
238 $this->change = $change;
239 }
240
244 public function setPreviousValue(?string $previousValue): void
245 {
246 $this->previousValue = $previousValue;
247 }
248
252 public function setNextValue(?string $nextValue): void
253 {
254 $this->nextValue = $nextValue;
255 }
256
260 public function setAsset(?AssetChangeValue $asset): void
261 {
262 $this->asset = $asset;
263 }
264
268 public function setCatalogData(?string $catalogData): void
269 {
270 $this->catalogData = $catalogData;
271 }
272
276 public function setVariant(?string $variant): void
277 {
278 $this->variant = $variant;
279 }
280
281
282
283}
__construct(?string $change=null, ?string $previousValue=null, ?string $nextValue=null, ?AssetChangeValue $asset=null, ?string $catalogData=null, ?string $variant=null, ?string $type=null)