commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetAssetSourcesChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
19
24{
25
26 public const DISCRIMINATOR_VALUE = 'SetAssetSourcesChange';
31 protected $type;
32
37 protected $change;
38
43 protected $previousValue;
44
49 protected $nextValue;
50
55 protected $asset;
56
61 protected $catalogData;
62
67 protected $variant;
68
69
73 public function __construct(
74 ?string $change = null,
78 ?string $catalogData = null,
79 ?string $variant = null,
80 ?string $type = null
81 ) {
82 $this->change = $change;
83 $this->previousValue = $previousValue;
84 $this->nextValue = $nextValue;
85 $this->asset = $asset;
86 $this->catalogData = $catalogData;
87 $this->variant = $variant;
88 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
89 }
90
95 public function getType()
96 {
97 if (is_null($this->type)) {
99 $data = $this->raw(self::FIELD_TYPE);
100 if (is_null($data)) {
101 return null;
102 }
103 $this->type = (string) $data;
104 }
105
106 return $this->type;
107 }
108
113 public function getChange()
114 {
115 if (is_null($this->change)) {
117 $data = $this->raw(self::FIELD_CHANGE);
118 if (is_null($data)) {
119 return null;
120 }
121 $this->change = (string) $data;
122 }
123
124 return $this->change;
125 }
126
133 public function getPreviousValue()
134 {
135 if (is_null($this->previousValue)) {
137 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
138 if (is_null($data)) {
139 return null;
140 }
141 $this->previousValue = AssetSourceCollection::fromArray($data);
142 }
143
145 }
146
153 public function getNextValue()
154 {
155 if (is_null($this->nextValue)) {
157 $data = $this->raw(self::FIELD_NEXT_VALUE);
158 if (is_null($data)) {
159 return null;
160 }
161 $this->nextValue = AssetSourceCollection::fromArray($data);
162 }
163
164 return $this->nextValue;
165 }
166
173 public function getAsset()
174 {
175 if (is_null($this->asset)) {
177 $data = $this->raw(self::FIELD_ASSET);
178 if (is_null($data)) {
179 return null;
180 }
181
182 $this->asset = AssetChangeValueModel::of($data);
183 }
184
185 return $this->asset;
186 }
187
198 public function getCatalogData()
199 {
200 if (is_null($this->catalogData)) {
202 $data = $this->raw(self::FIELD_CATALOG_DATA);
203 if (is_null($data)) {
204 return null;
205 }
206 $this->catalogData = (string) $data;
207 }
208
209 return $this->catalogData;
210 }
211
219 public function getVariant()
220 {
221 if (is_null($this->variant)) {
223 $data = $this->raw(self::FIELD_VARIANT);
224 if (is_null($data)) {
225 return null;
226 }
227 $this->variant = (string) $data;
228 }
229
230 return $this->variant;
231 }
232
233
237 public function setChange(?string $change): void
238 {
239 $this->change = $change;
240 }
241
246 {
247 $this->previousValue = $previousValue;
248 }
249
254 {
255 $this->nextValue = $nextValue;
256 }
257
261 public function setAsset(?AssetChangeValue $asset): void
262 {
263 $this->asset = $asset;
264 }
265
269 public function setCatalogData(?string $catalogData): void
270 {
271 $this->catalogData = $catalogData;
272 }
273
277 public function setVariant(?string $variant): void
278 {
279 $this->variant = $variant;
280 }
281
282
283
284}
__construct(?string $change=null, ?AssetSourceCollection $previousValue=null, ?AssetSourceCollection $nextValue=null, ?AssetChangeValue $asset=null, ?string $catalogData=null, ?string $variant=null, ?string $type=null)