commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetDiscountedPriceChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
20
25{
26
27 public const DISCRIMINATOR_VALUE = 'SetDiscountedPriceChange';
32 protected $type;
33
38 protected $change;
39
44 protected $previousValue;
45
50 protected $nextValue;
51
56 protected $catalogData;
57
62 protected $variant;
63
68 protected $priceId;
69
74 protected $price;
75
76
80 public function __construct(
81 ?string $change = null,
84 ?string $catalogData = null,
85 ?string $variant = null,
86 ?string $priceId = null,
87 ?Price $price = null,
88 ?string $type = null
89 ) {
90 $this->change = $change;
91 $this->previousValue = $previousValue;
92 $this->nextValue = $nextValue;
93 $this->catalogData = $catalogData;
94 $this->variant = $variant;
95 $this->priceId = $priceId;
96 $this->price = $price;
97 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
98 }
99
104 public function getType()
105 {
106 if (is_null($this->type)) {
108 $data = $this->raw(self::FIELD_TYPE);
109 if (is_null($data)) {
110 return null;
111 }
112 $this->type = (string) $data;
113 }
114
115 return $this->type;
116 }
117
122 public function getChange()
123 {
124 if (is_null($this->change)) {
126 $data = $this->raw(self::FIELD_CHANGE);
127 if (is_null($data)) {
128 return null;
129 }
130 $this->change = (string) $data;
131 }
132
133 return $this->change;
134 }
135
142 public function getPreviousValue()
143 {
144 if (is_null($this->previousValue)) {
146 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
147 if (is_null($data)) {
148 return null;
149 }
150
151 $this->previousValue = DiscountedPriceModel::of($data);
152 }
153
155 }
156
163 public function getNextValue()
164 {
165 if (is_null($this->nextValue)) {
167 $data = $this->raw(self::FIELD_NEXT_VALUE);
168 if (is_null($data)) {
169 return null;
170 }
171
172 $this->nextValue = DiscountedPriceModel::of($data);
173 }
174
175 return $this->nextValue;
176 }
177
188 public function getCatalogData()
189 {
190 if (is_null($this->catalogData)) {
192 $data = $this->raw(self::FIELD_CATALOG_DATA);
193 if (is_null($data)) {
194 return null;
195 }
196 $this->catalogData = (string) $data;
197 }
198
199 return $this->catalogData;
200 }
201
209 public function getVariant()
210 {
211 if (is_null($this->variant)) {
213 $data = $this->raw(self::FIELD_VARIANT);
214 if (is_null($data)) {
215 return null;
216 }
217 $this->variant = (string) $data;
218 }
219
220 return $this->variant;
221 }
222
229 public function getPriceId()
230 {
231 if (is_null($this->priceId)) {
233 $data = $this->raw(self::FIELD_PRICE_ID);
234 if (is_null($data)) {
235 return null;
236 }
237 $this->priceId = (string) $data;
238 }
239
240 return $this->priceId;
241 }
242
249 public function getPrice()
250 {
251 if (is_null($this->price)) {
253 $data = $this->raw(self::FIELD_PRICE);
254 if (is_null($data)) {
255 return null;
256 }
257
258 $this->price = PriceModel::of($data);
259 }
260
261 return $this->price;
262 }
263
264
268 public function setChange(?string $change): void
269 {
270 $this->change = $change;
271 }
272
277 {
278 $this->previousValue = $previousValue;
279 }
280
285 {
286 $this->nextValue = $nextValue;
287 }
288
292 public function setCatalogData(?string $catalogData): void
293 {
294 $this->catalogData = $catalogData;
295 }
296
300 public function setVariant(?string $variant): void
301 {
302 $this->variant = $variant;
303 }
304
308 public function setPriceId(?string $priceId): void
309 {
310 $this->priceId = $priceId;
311 }
312
316 public function setPrice(?Price $price): void
317 {
318 $this->price = $price;
319 }
320
321
322
323}
__construct(?string $change=null, ?DiscountedPrice $previousValue=null, ?DiscountedPrice $nextValue=null, ?string $catalogData=null, ?string $variant=null, ?string $priceId=null, ?Price $price=null, ?string $type=null)