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
126 public function getId()
127 {
128 return $this->id;
129 }
130
137 public function getVersion()
138 {
139 return $this->version;
140 }
141
148 public function getCreatedAt()
149 {
150 return $this->createdAt;
151 }
152
159 public function getLastModifiedAt()
160 {
161 return $this->lastModifiedAt;
162 }
163
170 public function getLastModifiedBy()
171 {
172 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
173 }
174
181 public function getCreatedBy()
182 {
183 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
184 }
185
192 public function getKey()
193 {
194 return $this->key;
195 }
196
203 public function getName()
204 {
205 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
206 }
207
214 public function getLanguages()
215 {
216 return $this->languages;
217 }
218
225 public function getCountries()
226 {
227 return $this->countries;
228 }
229
236 public function getDistributionChannels()
237 {
238 return $this->distributionChannels;
239 }
240
247 public function getSupplyChannels()
248 {
249 return $this->supplyChannels;
250 }
251
264 public function getProductSelections()
265 {
266 return $this->productSelections;
267 }
268
275 public function getCustom()
276 {
277 return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
278 }
279
284 public function withId(?string $id)
285 {
286 $this->id = $id;
287
288 return $this;
289 }
290
295 public function withVersion(?int $version)
296 {
297 $this->version = $version;
298
299 return $this;
300 }
301
306 public function withCreatedAt(?DateTimeImmutable $createdAt)
307 {
308 $this->createdAt = $createdAt;
309
310 return $this;
311 }
312
317 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
318 {
319 $this->lastModifiedAt = $lastModifiedAt;
320
321 return $this;
322 }
323
328 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
329 {
330 $this->lastModifiedBy = $lastModifiedBy;
331
332 return $this;
333 }
334
339 public function withCreatedBy(?CreatedBy $createdBy)
340 {
341 $this->createdBy = $createdBy;
342
343 return $this;
344 }
345
350 public function withKey(?string $key)
351 {
352 $this->key = $key;
353
354 return $this;
355 }
356
361 public function withName(?LocalizedString $name)
362 {
363 $this->name = $name;
364
365 return $this;
366 }
367
372 public function withLanguages(?array $languages)
373 {
374 $this->languages = $languages;
375
376 return $this;
377 }
378
383 public function withCountries(?StoreCountryCollection $countries)
384 {
385 $this->countries = $countries;
386
387 return $this;
388 }
389
394 public function withDistributionChannels(?ChannelReferenceCollection $distributionChannels)
395 {
396 $this->distributionChannels = $distributionChannels;
397
398 return $this;
399 }
400
405 public function withSupplyChannels(?ChannelReferenceCollection $supplyChannels)
406 {
407 $this->supplyChannels = $supplyChannels;
408
409 return $this;
410 }
411
416 public function withProductSelections(?ProductSelectionSettingCollection $productSelections)
417 {
418 $this->productSelections = $productSelections;
419
420 return $this;
421 }
422
427 public function withCustom(?CustomFields $custom)
428 {
429 $this->custom = $custom;
430
431 return $this;
432 }
433
438 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
439 {
440 $this->lastModifiedBy = $lastModifiedBy;
441
442 return $this;
443 }
444
449 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
450 {
451 $this->createdBy = $createdBy;
452
453 return $this;
454 }
455
461 {
462 $this->name = $name;
463
464 return $this;
465 }
466
471 public function withCustomBuilder(?CustomFieldsBuilder $custom)
472 {
473 $this->custom = $custom;
474
475 return $this;
476 }
477
478 public function build(): Store
479 {
480 return new StoreModel(
481 $this->id,
482 $this->version,
483 $this->createdAt,
484 $this->lastModifiedAt,
485 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
486 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
487 $this->key,
488 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
489 $this->languages,
490 $this->countries,
491 $this->distributionChannels,
492 $this->supplyChannels,
493 $this->productSelections,
494 $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom
495 );
496 }
497
498 public static function of(): StoreBuilder
499 {
500 return new self();
501 }
502}
withCustomBuilder(?CustomFieldsBuilder $custom)
withProductSelections(?ProductSelectionSettingCollection $productSelections)
withCountries(?StoreCountryCollection $countries)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
withDistributionChannels(?ChannelReferenceCollection $distributionChannels)
withCreatedByBuilder(?CreatedByBuilder $createdBy)
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
withCreatedAt(?DateTimeImmutable $createdAt)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withNameBuilder(?LocalizedStringBuilder $name)
withSupplyChannels(?ChannelReferenceCollection $supplyChannels)