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
68
72 public function __construct(
73 ?string $change = null,
74 $previousValue = null,
75 $nextValue = null,
76 ?string $name = null,
77 ?string $customTypeId = null,
79 ?string $type = null
80 ) {
81 $this->change = $change;
82 $this->previousValue = $previousValue;
83 $this->nextValue = $nextValue;
84 $this->name = $name;
85 $this->customTypeId = $customTypeId;
86 $this->asset = $asset;
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 = $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 = $data;
161 }
162
163 return $this->nextValue;
164 }
165
172 public function getName()
173 {
174 if (is_null($this->name)) {
176 $data = $this->raw(self::FIELD_NAME);
177 if (is_null($data)) {
178 return null;
179 }
180 $this->name = (string) $data;
181 }
182
183 return $this->name;
184 }
185
192 public function getCustomTypeId()
193 {
194 if (is_null($this->customTypeId)) {
196 $data = $this->raw(self::FIELD_CUSTOM_TYPE_ID);
197 if (is_null($data)) {
198 return null;
199 }
200 $this->customTypeId = (string) $data;
201 }
202
203 return $this->customTypeId;
204 }
205
212 public function getAsset()
213 {
214 if (is_null($this->asset)) {
216 $data = $this->raw(self::FIELD_ASSET);
217 if (is_null($data)) {
218 return null;
219 }
220
221 $this->asset = AssetChangeValueModel::of($data);
222 }
223
224 return $this->asset;
225 }
226
227
231 public function setChange(?string $change): void
232 {
233 $this->change = $change;
234 }
235
239 public function setPreviousValue( $previousValue): void
240 {
241 $this->previousValue = $previousValue;
242 }
243
247 public function setNextValue( $nextValue): void
248 {
249 $this->nextValue = $nextValue;
250 }
251
255 public function setName(?string $name): void
256 {
257 $this->name = $name;
258 }
259
263 public function setCustomTypeId(?string $customTypeId): void
264 {
265 $this->customTypeId = $customTypeId;
266 }
267
271 public function setAsset(?AssetChangeValue $asset): void
272 {
273 $this->asset = $asset;
274 }
275
276
277
278}
__construct(?string $change=null, $previousValue=null, $nextValue=null, ?string $name=null, ?string $customTypeId=null, ?AssetChangeValue $asset=null, ?string $type=null)