commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StoreBuilder.php
1<?php
2
3declare(strict_types=1);
10
28use DateTimeImmutable;
29use stdClass;
30
34final class StoreBuilder implements Builder
35{
40 private $id;
41
46 private $version;
47
52 private $createdAt;
53
58 private $lastModifiedAt;
59
64 private $lastModifiedBy;
65
70 private $createdBy;
71
76 private $key;
77
82 private $name;
83
88 private $languages;
89
94 private $countries;
95
100 private $distributionChannels;
101
106 private $supplyChannels;
107
112 private $productSelections;
113
118 private $custom;
119
124 private $storefront;
125
132 public function getId()
133 {
134 return $this->id;
135 }
136
143 public function getVersion()
144 {
145 return $this->version;
146 }
147
154 public function getCreatedAt()
155 {
156 return $this->createdAt;
157 }
158
165 public function getLastModifiedAt()
166 {
167 return $this->lastModifiedAt;
168 }
169
176 public function getLastModifiedBy()
177 {
178 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
179 }
180
187 public function getCreatedBy()
188 {
189 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
190 }
191
198 public function getKey()
199 {
200 return $this->key;
201 }
202
209 public function getName()
210 {
211 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
212 }
213
220 public function getLanguages()
221 {
222 return $this->languages;
223 }
224
231 public function getCountries()
232 {
233 return $this->countries;
234 }
235
242 public function getDistributionChannels()
243 {
244 return $this->distributionChannels;
245 }
246
253 public function getSupplyChannels()
254 {
255 return $this->supplyChannels;
256 }
257
270 public function getProductSelections()
271 {
272 return $this->productSelections;
273 }
274
281 public function getCustom()
282 {
283 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
284 }
285
292 public function getStorefront()
293 {
294 return $this->storefront instanceof StorefrontBuilder ? $this->storefront->build() : $this->storefront;
295 }
296
301 public function withId(?string $id)
302 {
303 $this->id = $id;
304
305 return $this;
306 }
307
312 public function withVersion(?int $version)
313 {
314 $this->version = $version;
315
316 return $this;
317 }
318
323 public function withCreatedAt(?DateTimeImmutable $createdAt)
324 {
325 $this->createdAt = $createdAt;
326
327 return $this;
328 }
329
334 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
335 {
336 $this->lastModifiedAt = $lastModifiedAt;
337
338 return $this;
339 }
340
345 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
346 {
347 $this->lastModifiedBy = $lastModifiedBy;
348
349 return $this;
350 }
351
356 public function withCreatedBy(?CreatedBy $createdBy)
357 {
358 $this->createdBy = $createdBy;
359
360 return $this;
361 }
362
367 public function withKey(?string $key)
368 {
369 $this->key = $key;
370
371 return $this;
372 }
373
378 public function withName(?LocalizedString $name)
379 {
380 $this->name = $name;
381
382 return $this;
383 }
384
389 public function withLanguages(?array $languages)
390 {
391 $this->languages = $languages;
392
393 return $this;
394 }
395
400 public function withCountries(?StoreCountryCollection $countries)
401 {
402 $this->countries = $countries;
403
404 return $this;
405 }
406
411 public function withDistributionChannels(?ChannelReferenceCollection $distributionChannels)
412 {
413 $this->distributionChannels = $distributionChannels;
414
415 return $this;
416 }
417
422 public function withSupplyChannels(?ChannelReferenceCollection $supplyChannels)
423 {
424 $this->supplyChannels = $supplyChannels;
425
426 return $this;
427 }
428
433 public function withProductSelections(?ProductSelectionSettingCollection $productSelections)
434 {
435 $this->productSelections = $productSelections;
436
437 return $this;
438 }
439
444 public function withCustom(?CustomFields $custom)
445 {
446 $this->custom = $custom;
447
448 return $this;
449 }
450
455 public function withStorefront(?Storefront $storefront)
456 {
457 $this->storefront = $storefront;
458
459 return $this;
460 }
461
466 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
467 {
468 $this->lastModifiedBy = $lastModifiedBy;
469
470 return $this;
471 }
472
477 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
478 {
479 $this->createdBy = $createdBy;
480
481 return $this;
482 }
483
489 {
490 $this->name = $name;
491
492 return $this;
493 }
494
499 public function withCustomBuilder(?CustomFieldsBuilder $custom)
500 {
501 $this->custom = $custom;
502
503 return $this;
504 }
505
510 public function withStorefrontBuilder(?StorefrontBuilder $storefront)
511 {
512 $this->storefront = $storefront;
513
514 return $this;
515 }
516
517 public function build(): Store
518 {
519 return new StoreModel(
520 $this->id,
521 $this->version,
522 $this->createdAt,
523 $this->lastModifiedAt,
524 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
525 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
526 $this->key,
527 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
528 $this->languages,
529 $this->countries,
530 $this->distributionChannels,
531 $this->supplyChannels,
532 $this->productSelections,
533 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom,
534 $this->storefront instanceof StorefrontBuilder ? $this->storefront->build() : $this->storefront
535 );
536 }
537
538 public static function of(): StoreBuilder
539 {
540 return new self();
541 }
542}
withCustomBuilder(?CustomFieldsBuilder $custom)
withProductSelections(?ProductSelectionSettingCollection $productSelections)
withCountries(?StoreCountryCollection $countries)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
withDistributionChannels(?ChannelReferenceCollection $distributionChannels)
withCreatedByBuilder(?CreatedByBuilder $createdBy)
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
withCreatedAt(?DateTimeImmutable $createdAt)
withStorefrontBuilder(?StorefrontBuilder $storefront)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withNameBuilder(?LocalizedStringBuilder $name)
withSupplyChannels(?ChannelReferenceCollection $supplyChannels)