commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ValidityLockConflictErrorModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
28 public const DISCRIMINATOR_VALUE = 'ValidityLockConflict';
33 protected $code;
34
39 protected $message;
40
45 protected $sku;
46
51 protected $currency;
52
57 protected $country;
58
63 protected $customerGroup;
64
69 protected $channel;
70
76
77
81 public function __construct(
82 ?string $message = null,
83 ?string $sku = null,
84 ?string $currency = null,
85 ?string $country = null,
89 ?string $code = null
90 ) {
91 $this->message = $message;
92 $this->sku = $sku;
93 $this->currency = $currency;
94 $this->country = $country;
95 $this->customerGroup = $customerGroup;
96 $this->channel = $channel;
97 $this->recurrencePolicy = $recurrencePolicy;
98 $this->code = $code ?? self::DISCRIMINATOR_VALUE;
99 }
100
105 public function getCode()
106 {
107 if (is_null($this->code)) {
109 $data = $this->raw(self::FIELD_CODE);
110 if (is_null($data)) {
111 return null;
112 }
113 $this->code = (string) $data;
114 }
115
116 return $this->code;
117 }
118
125 public function getMessage()
126 {
127 if (is_null($this->message)) {
129 $data = $this->raw(self::FIELD_MESSAGE);
130 if (is_null($data)) {
131 return null;
132 }
133 $this->message = (string) $data;
134 }
135
136 return $this->message;
137 }
138
145 public function getSku()
146 {
147 if (is_null($this->sku)) {
149 $data = $this->raw(self::FIELD_SKU);
150 if (is_null($data)) {
151 return null;
152 }
153 $this->sku = (string) $data;
154 }
155
156 return $this->sku;
157 }
158
165 public function getCurrency()
166 {
167 if (is_null($this->currency)) {
169 $data = $this->raw(self::FIELD_CURRENCY);
170 if (is_null($data)) {
171 return null;
172 }
173 $this->currency = (string) $data;
174 }
175
176 return $this->currency;
177 }
178
185 public function getCountry()
186 {
187 if (is_null($this->country)) {
189 $data = $this->raw(self::FIELD_COUNTRY);
190 if (is_null($data)) {
191 return null;
192 }
193 $this->country = (string) $data;
194 }
195
196 return $this->country;
197 }
198
205 public function getCustomerGroup()
206 {
207 if (is_null($this->customerGroup)) {
209 $data = $this->raw(self::FIELD_CUSTOMER_GROUP);
210 if (is_null($data)) {
211 return null;
212 }
213
214 $this->customerGroup = CustomerGroupResourceIdentifierModel::of($data);
215 }
216
218 }
219
226 public function getChannel()
227 {
228 if (is_null($this->channel)) {
230 $data = $this->raw(self::FIELD_CHANNEL);
231 if (is_null($data)) {
232 return null;
233 }
234
235 $this->channel = ChannelResourceIdentifierModel::of($data);
236 }
237
238 return $this->channel;
239 }
240
247 public function getRecurrencePolicy()
248 {
249 if (is_null($this->recurrencePolicy)) {
251 $data = $this->raw(self::FIELD_RECURRENCE_POLICY);
252 if (is_null($data)) {
253 return null;
254 }
255
256 $this->recurrencePolicy = RecurrencePolicyResourceIdentifierModel::of($data);
257 }
258
260 }
261
262
266 public function setMessage(?string $message): void
267 {
268 $this->message = $message;
269 }
270
274 public function setSku(?string $sku): void
275 {
276 $this->sku = $sku;
277 }
278
282 public function setCurrency(?string $currency): void
283 {
284 $this->currency = $currency;
285 }
286
290 public function setCountry(?string $country): void
291 {
292 $this->country = $country;
293 }
294
299 {
300 $this->customerGroup = $customerGroup;
301 }
302
307 {
308 $this->channel = $channel;
309 }
310
315 {
316 $this->recurrencePolicy = $recurrencePolicy;
317 }
318
322 public function by(string $key)
323 {
324 $data = $this->raw($key);
325 if (is_null($data)) {
326 return null;
327 }
328
329 return $data;
330 }
331}
__construct(?string $message=null, ?string $sku=null, ?string $currency=null, ?string $country=null, ?CustomerGroupResourceIdentifier $customerGroup=null, ?ChannelResourceIdentifier $channel=null, ?RecurrencePolicyResourceIdentifier $recurrencePolicy=null, ?string $code=null)
setRecurrencePolicy(?RecurrencePolicyResourceIdentifier $recurrencePolicy)