commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AddPriceChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'AddPriceChange';
30 protected $type;
31
36 protected $change;
37
42 protected $nextValue;
43
48 protected $catalogData;
49
54 protected $priceId;
55
60 protected $variant;
61
62
66 public function __construct(
67 ?string $change = null,
68 ?Price $nextValue = null,
69 ?string $catalogData = null,
70 ?string $priceId = null,
71 ?string $variant = null,
72 ?string $type = null
73 ) {
74 $this->change = $change;
75 $this->nextValue = $nextValue;
76 $this->catalogData = $catalogData;
77 $this->priceId = $priceId;
78 $this->variant = $variant;
79 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
80 }
81
86 public function getType()
87 {
88 if (is_null($this->type)) {
90 $data = $this->raw(self::FIELD_TYPE);
91 if (is_null($data)) {
92 return null;
93 }
94 $this->type = (string) $data;
95 }
96
97 return $this->type;
98 }
99
104 public function getChange()
105 {
106 if (is_null($this->change)) {
108 $data = $this->raw(self::FIELD_CHANGE);
109 if (is_null($data)) {
110 return null;
111 }
112 $this->change = (string) $data;
113 }
114
115 return $this->change;
116 }
117
124 public function getNextValue()
125 {
126 if (is_null($this->nextValue)) {
128 $data = $this->raw(self::FIELD_NEXT_VALUE);
129 if (is_null($data)) {
130 return null;
131 }
132
133 $this->nextValue = PriceModel::of($data);
134 }
135
136 return $this->nextValue;
137 }
138
149 public function getCatalogData()
150 {
151 if (is_null($this->catalogData)) {
153 $data = $this->raw(self::FIELD_CATALOG_DATA);
154 if (is_null($data)) {
155 return null;
156 }
157 $this->catalogData = (string) $data;
158 }
159
160 return $this->catalogData;
161 }
162
169 public function getPriceId()
170 {
171 if (is_null($this->priceId)) {
173 $data = $this->raw(self::FIELD_PRICE_ID);
174 if (is_null($data)) {
175 return null;
176 }
177 $this->priceId = (string) $data;
178 }
179
180 return $this->priceId;
181 }
182
190 public function getVariant()
191 {
192 if (is_null($this->variant)) {
194 $data = $this->raw(self::FIELD_VARIANT);
195 if (is_null($data)) {
196 return null;
197 }
198 $this->variant = (string) $data;
199 }
200
201 return $this->variant;
202 }
203
204
208 public function setChange(?string $change): void
209 {
210 $this->change = $change;
211 }
212
216 public function setNextValue(?Price $nextValue): void
217 {
218 $this->nextValue = $nextValue;
219 }
220
224 public function setCatalogData(?string $catalogData): void
225 {
226 $this->catalogData = $catalogData;
227 }
228
232 public function setPriceId(?string $priceId): void
233 {
234 $this->priceId = $priceId;
235 }
236
240 public function setVariant(?string $variant): void
241 {
242 $this->variant = $variant;
243 }
244
245
246
247}
__construct(?string $change=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $priceId=null, ?string $variant=null, ?string $type=null)