commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductProjectionBuilder.php
1<?php
2
3declare(strict_types=1);
10
29use DateTimeImmutable;
30use stdClass;
31
35final class ProductProjectionBuilder implements Builder
36{
41 private $id;
42
47 private $version;
48
53 private $createdAt;
54
59 private $lastModifiedAt;
60
65 private $key;
66
71 private $productType;
72
77 private $name;
78
83 private $description;
84
89 private $slug;
90
95 private $categories;
96
101 private $categoryOrderHints;
102
107 private $metaTitle;
108
113 private $metaDescription;
114
119 private $metaKeywords;
120
125 private $searchKeywords;
126
131 private $hasStagedChanges;
132
137 private $published;
138
143 private $masterVariant;
144
149 private $variants;
150
155 private $taxCategory;
156
161 private $state;
162
167 private $reviewRatingStatistics;
168
173 private $priceMode;
174
179 private $attributes;
180
187 public function getId()
188 {
189 return $this->id;
190 }
191
198 public function getVersion()
199 {
200 return $this->version;
201 }
202
209 public function getCreatedAt()
210 {
211 return $this->createdAt;
212 }
213
220 public function getLastModifiedAt()
221 {
222 return $this->lastModifiedAt;
223 }
224
231 public function getKey()
232 {
233 return $this->key;
234 }
235
242 public function getProductType()
243 {
244 return $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType;
245 }
246
253 public function getName()
254 {
255 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
256 }
257
264 public function getDescription()
265 {
266 return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
267 }
268
278 public function getSlug()
279 {
280 return $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug;
281 }
282
289 public function getCategories()
290 {
291 return $this->categories;
292 }
293
300 public function getCategoryOrderHints()
301 {
302 return $this->categoryOrderHints instanceof CategoryOrderHintsBuilder ? $this->categoryOrderHints->build() : $this->categoryOrderHints;
303 }
304
311 public function getMetaTitle()
312 {
313 return $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle;
314 }
315
322 public function getMetaDescription()
323 {
324 return $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription;
325 }
326
333 public function getMetaKeywords()
334 {
335 return $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords;
336 }
337
344 public function getSearchKeywords()
345 {
346 return $this->searchKeywords instanceof SearchKeywordsBuilder ? $this->searchKeywords->build() : $this->searchKeywords;
347 }
348
355 public function getHasStagedChanges()
356 {
357 return $this->hasStagedChanges;
358 }
359
366 public function getPublished()
367 {
368 return $this->published;
369 }
370
378 public function getMasterVariant()
379 {
380 return $this->masterVariant instanceof ProductVariantBuilder ? $this->masterVariant->build() : $this->masterVariant;
381 }
382
390 public function getVariants()
391 {
392 return $this->variants;
393 }
394
401 public function getTaxCategory()
402 {
403 return $this->taxCategory instanceof TaxCategoryReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory;
404 }
405
412 public function getState()
413 {
414 return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
415 }
416
424 {
425 return $this->reviewRatingStatistics instanceof ReviewRatingStatisticsBuilder ? $this->reviewRatingStatistics->build() : $this->reviewRatingStatistics;
426 }
427
435 public function getPriceMode()
436 {
437 return $this->priceMode;
438 }
439
446 public function getAttributes()
447 {
448 return $this->attributes;
449 }
450
455 public function withId(?string $id)
456 {
457 $this->id = $id;
458
459 return $this;
460 }
461
466 public function withVersion(?int $version)
467 {
468 $this->version = $version;
469
470 return $this;
471 }
472
477 public function withCreatedAt(?DateTimeImmutable $createdAt)
478 {
479 $this->createdAt = $createdAt;
480
481 return $this;
482 }
483
488 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
489 {
490 $this->lastModifiedAt = $lastModifiedAt;
491
492 return $this;
493 }
494
499 public function withKey(?string $key)
500 {
501 $this->key = $key;
502
503 return $this;
504 }
505
510 public function withProductType(?ProductTypeReference $productType)
511 {
512 $this->productType = $productType;
513
514 return $this;
515 }
516
521 public function withName(?LocalizedString $name)
522 {
523 $this->name = $name;
524
525 return $this;
526 }
527
532 public function withDescription(?LocalizedString $description)
533 {
534 $this->description = $description;
535
536 return $this;
537 }
538
543 public function withSlug(?LocalizedString $slug)
544 {
545 $this->slug = $slug;
546
547 return $this;
548 }
549
554 public function withCategories(?CategoryReferenceCollection $categories)
555 {
556 $this->categories = $categories;
557
558 return $this;
559 }
560
565 public function withCategoryOrderHints(?CategoryOrderHints $categoryOrderHints)
566 {
567 $this->categoryOrderHints = $categoryOrderHints;
568
569 return $this;
570 }
571
576 public function withMetaTitle(?LocalizedString $metaTitle)
577 {
578 $this->metaTitle = $metaTitle;
579
580 return $this;
581 }
582
587 public function withMetaDescription(?LocalizedString $metaDescription)
588 {
589 $this->metaDescription = $metaDescription;
590
591 return $this;
592 }
593
598 public function withMetaKeywords(?LocalizedString $metaKeywords)
599 {
600 $this->metaKeywords = $metaKeywords;
601
602 return $this;
603 }
604
609 public function withSearchKeywords(?SearchKeywords $searchKeywords)
610 {
611 $this->searchKeywords = $searchKeywords;
612
613 return $this;
614 }
615
620 public function withHasStagedChanges(?bool $hasStagedChanges)
621 {
622 $this->hasStagedChanges = $hasStagedChanges;
623
624 return $this;
625 }
626
631 public function withPublished(?bool $published)
632 {
633 $this->published = $published;
634
635 return $this;
636 }
637
642 public function withMasterVariant(?ProductVariant $masterVariant)
643 {
644 $this->masterVariant = $masterVariant;
645
646 return $this;
647 }
648
653 public function withVariants(?ProductVariantCollection $variants)
654 {
655 $this->variants = $variants;
656
657 return $this;
658 }
659
664 public function withTaxCategory(?TaxCategoryReference $taxCategory)
665 {
666 $this->taxCategory = $taxCategory;
667
668 return $this;
669 }
670
675 public function withState(?StateReference $state)
676 {
677 $this->state = $state;
678
679 return $this;
680 }
681
686 public function withReviewRatingStatistics(?ReviewRatingStatistics $reviewRatingStatistics)
687 {
688 $this->reviewRatingStatistics = $reviewRatingStatistics;
689
690 return $this;
691 }
692
697 public function withPriceMode(?string $priceMode)
698 {
699 $this->priceMode = $priceMode;
700
701 return $this;
702 }
703
708 public function withAttributes(?AttributeCollection $attributes)
709 {
710 $this->attributes = $attributes;
711
712 return $this;
713 }
714
720 {
721 $this->productType = $productType;
722
723 return $this;
724 }
725
731 {
732 $this->name = $name;
733
734 return $this;
735 }
736
741 public function withDescriptionBuilder(?LocalizedStringBuilder $description)
742 {
743 $this->description = $description;
744
745 return $this;
746 }
747
753 {
754 $this->slug = $slug;
755
756 return $this;
757 }
758
763 public function withCategoryOrderHintsBuilder(?CategoryOrderHintsBuilder $categoryOrderHints)
764 {
765 $this->categoryOrderHints = $categoryOrderHints;
766
767 return $this;
768 }
769
774 public function withMetaTitleBuilder(?LocalizedStringBuilder $metaTitle)
775 {
776 $this->metaTitle = $metaTitle;
777
778 return $this;
779 }
780
785 public function withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
786 {
787 $this->metaDescription = $metaDescription;
788
789 return $this;
790 }
791
796 public function withMetaKeywordsBuilder(?LocalizedStringBuilder $metaKeywords)
797 {
798 $this->metaKeywords = $metaKeywords;
799
800 return $this;
801 }
802
807 public function withSearchKeywordsBuilder(?SearchKeywordsBuilder $searchKeywords)
808 {
809 $this->searchKeywords = $searchKeywords;
810
811 return $this;
812 }
813
818 public function withMasterVariantBuilder(?ProductVariantBuilder $masterVariant)
819 {
820 $this->masterVariant = $masterVariant;
821
822 return $this;
823 }
824
830 {
831 $this->taxCategory = $taxCategory;
832
833 return $this;
834 }
835
841 {
842 $this->state = $state;
843
844 return $this;
845 }
846
851 public function withReviewRatingStatisticsBuilder(?ReviewRatingStatisticsBuilder $reviewRatingStatistics)
852 {
853 $this->reviewRatingStatistics = $reviewRatingStatistics;
854
855 return $this;
856 }
857
858 public function build(): ProductProjection
859 {
860 return new ProductProjectionModel(
861 $this->id,
862 $this->version,
863 $this->createdAt,
864 $this->lastModifiedAt,
865 $this->key,
866 $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType,
867 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
868 $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
869 $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug,
870 $this->categories,
871 $this->categoryOrderHints instanceof CategoryOrderHintsBuilder ? $this->categoryOrderHints->build() : $this->categoryOrderHints,
872 $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle,
873 $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription,
874 $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords,
875 $this->searchKeywords instanceof SearchKeywordsBuilder ? $this->searchKeywords->build() : $this->searchKeywords,
876 $this->hasStagedChanges,
877 $this->published,
878 $this->masterVariant instanceof ProductVariantBuilder ? $this->masterVariant->build() : $this->masterVariant,
879 $this->variants,
880 $this->taxCategory instanceof TaxCategoryReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory,
881 $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
882 $this->reviewRatingStatistics instanceof ReviewRatingStatisticsBuilder ? $this->reviewRatingStatistics->build() : $this->reviewRatingStatistics,
883 $this->priceMode,
884 $this->attributes
885 );
886 }
887
888 public static function of(): ProductProjectionBuilder
889 {
890 return new self();
891 }
892}
withReviewRatingStatistics(?ReviewRatingStatistics $reviewRatingStatistics)
withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
withReviewRatingStatisticsBuilder(?ReviewRatingStatisticsBuilder $reviewRatingStatistics)
withProductTypeBuilder(?ProductTypeReferenceBuilder $productType)
withTaxCategoryBuilder(?TaxCategoryReferenceBuilder $taxCategory)
withCategoryOrderHintsBuilder(?CategoryOrderHintsBuilder $categoryOrderHints)