commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StandalonePriceImportBuilder.php
1<?php
2
3declare(strict_types=1);
10
29use DateTimeImmutable;
30use stdClass;
31
36{
41 private $key;
42
47 private $sku;
48
53 private $value;
54
59 private $country;
60
65 private $customerGroup;
66
71 private $channel;
72
77 private $validFrom;
78
83 private $validUntil;
84
89 private $tiers;
90
95 private $discounted;
96
101 private $custom;
102
107 private $active;
108
115 public function getKey()
116 {
117 return $this->key;
118 }
119
126 public function getSku()
127 {
128 return $this->sku;
129 }
130
137 public function getValue()
138 {
139 return $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value;
140 }
141
148 public function getCountry()
149 {
150 return $this->country;
151 }
152
160 public function getCustomerGroup()
161 {
162 return $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup;
163 }
164
172 public function getChannel()
173 {
174 return $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel;
175 }
176
183 public function getValidFrom()
184 {
185 return $this->validFrom;
186 }
187
194 public function getValidUntil()
195 {
196 return $this->validUntil;
197 }
198
205 public function getTiers()
206 {
207 return $this->tiers;
208 }
209
216 public function getDiscounted()
217 {
218 return $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted;
219 }
220
227 public function getCustom()
228 {
229 return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
230 }
231
239 public function getActive()
240 {
241 return $this->active;
242 }
243
248 public function withKey(?string $key)
249 {
250 $this->key = $key;
251
252 return $this;
253 }
254
259 public function withSku(?string $sku)
260 {
261 $this->sku = $sku;
262
263 return $this;
264 }
265
270 public function withValue(?TypedMoney $value)
271 {
272 $this->value = $value;
273
274 return $this;
275 }
276
281 public function withCountry(?string $country)
282 {
283 $this->country = $country;
284
285 return $this;
286 }
287
292 public function withCustomerGroup(?CustomerGroupKeyReference $customerGroup)
293 {
294 $this->customerGroup = $customerGroup;
295
296 return $this;
297 }
298
303 public function withChannel(?ChannelKeyReference $channel)
304 {
305 $this->channel = $channel;
306
307 return $this;
308 }
309
314 public function withValidFrom(?DateTimeImmutable $validFrom)
315 {
316 $this->validFrom = $validFrom;
317
318 return $this;
319 }
320
325 public function withValidUntil(?DateTimeImmutable $validUntil)
326 {
327 $this->validUntil = $validUntil;
328
329 return $this;
330 }
331
336 public function withTiers(?PriceTierCollection $tiers)
337 {
338 $this->tiers = $tiers;
339
340 return $this;
341 }
342
347 public function withDiscounted(?DiscountedPrice $discounted)
348 {
349 $this->discounted = $discounted;
350
351 return $this;
352 }
353
358 public function withCustom(?Custom $custom)
359 {
360 $this->custom = $custom;
361
362 return $this;
363 }
364
369 public function withActive(?bool $active)
370 {
371 $this->active = $active;
372
373 return $this;
374 }
375
380 public function withValueBuilder(?TypedMoneyBuilder $value)
381 {
382 $this->value = $value;
383
384 return $this;
385 }
386
392 {
393 $this->customerGroup = $customerGroup;
394
395 return $this;
396 }
397
403 {
404 $this->channel = $channel;
405
406 return $this;
407 }
408
413 public function withDiscountedBuilder(?DiscountedPriceBuilder $discounted)
414 {
415 $this->discounted = $discounted;
416
417 return $this;
418 }
419
424 public function withCustomBuilder(?CustomBuilder $custom)
425 {
426 $this->custom = $custom;
427
428 return $this;
429 }
430
431 public function build(): StandalonePriceImport
432 {
434 $this->key,
435 $this->sku,
436 $this->value instanceof TypedMoneyBuilder ? $this->value->build() : $this->value,
437 $this->country,
438 $this->customerGroup instanceof CustomerGroupKeyReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup,
439 $this->channel instanceof ChannelKeyReferenceBuilder ? $this->channel->build() : $this->channel,
440 $this->validFrom,
441 $this->validUntil,
442 $this->tiers,
443 $this->discounted instanceof DiscountedPriceBuilder ? $this->discounted->build() : $this->discounted,
444 $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom,
445 $this->active
446 );
447 }
448
449 public static function of(): StandalonePriceImportBuilder
450 {
451 return new self();
452 }
453}