commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ChangePriceChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'ChangePriceChange';
30 protected $type;
31
36 protected $change;
37
42 protected $previousValue;
43
48 protected $nextValue;
49
54 protected $catalogData;
55
60 protected $priceId;
61
66 protected $variant;
67
68
72 public function __construct(
73 ?string $change = null,
74 ?Price $previousValue = null,
75 ?Price $nextValue = null,
76 ?string $catalogData = null,
77 ?string $priceId = null,
78 ?string $variant = null,
79 ?string $type = null
80 ) {
81 $this->change = $change;
82 $this->previousValue = $previousValue;
83 $this->nextValue = $nextValue;
84 $this->catalogData = $catalogData;
85 $this->priceId = $priceId;
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
141 $this->previousValue = PriceModel::of($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
162 $this->nextValue = PriceModel::of($data);
163 }
164
165 return $this->nextValue;
166 }
167
178 public function getCatalogData()
179 {
180 if (is_null($this->catalogData)) {
182 $data = $this->raw(self::FIELD_CATALOG_DATA);
183 if (is_null($data)) {
184 return null;
185 }
186 $this->catalogData = (string) $data;
187 }
188
189 return $this->catalogData;
190 }
191
198 public function getPriceId()
199 {
200 if (is_null($this->priceId)) {
202 $data = $this->raw(self::FIELD_PRICE_ID);
203 if (is_null($data)) {
204 return null;
205 }
206 $this->priceId = (string) $data;
207 }
208
209 return $this->priceId;
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
245 public function setPreviousValue(?Price $previousValue): void
246 {
247 $this->previousValue = $previousValue;
248 }
249
253 public function setNextValue(?Price $nextValue): void
254 {
255 $this->nextValue = $nextValue;
256 }
257
261 public function setCatalogData(?string $catalogData): void
262 {
263 $this->catalogData = $catalogData;
264 }
265
269 public function setPriceId(?string $priceId): void
270 {
271 $this->priceId = $priceId;
272 }
273
277 public function setVariant(?string $variant): void
278 {
279 $this->variant = $variant;
280 }
281
282
283
284}
__construct(?string $change=null, ?Price $previousValue=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $priceId=null, ?string $variant=null, ?string $type=null)