commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantAttributesBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class VariantAttributesBuilder implements Builder
22{
27 private $productId;
28
33 private $productKey;
34
39 private $attributes;
40
45 private $variants;
46
53 public function getProductId()
54 {
55 return $this->productId;
56 }
57
64 public function getProductKey()
65 {
66 return $this->productKey;
67 }
68
76 public function getAttributes()
77 {
78 return $this->attributes;
79 }
80
87 public function getVariants()
88 {
89 return $this->variants;
90 }
91
96 public function withProductId(?string $productId)
97 {
98 $this->productId = $productId;
99
100 return $this;
101 }
102
107 public function withProductKey(?string $productKey)
108 {
109 $this->productKey = $productKey;
110
111 return $this;
112 }
113
119 {
120 $this->attributes = $attributes;
121
122 return $this;
123 }
124
130 {
131 $this->variants = $variants;
132
133 return $this;
134 }
135
136
137 public function build(): VariantAttributes
138 {
139 return new VariantAttributesModel(
140 $this->productId,
141 $this->productKey,
142 $this->attributes,
143 $this->variants
144 );
145 }
146
147 public static function of(): VariantAttributesBuilder
148 {
149 return new self();
150 }
151}
withAttributes(?VariantAttributesAttributeMetadataCollection $attributes)