commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantCreatedMessagePayloadBuilder.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
27{
32 private $product;
33
38 private $id;
39
44 private $variantId;
45
50 private $key;
51
56 private $sku;
57
62 private $attributes;
63
68 private $assets;
69
74 private $images;
75
80 private $publish;
81
88 public function getProduct()
89 {
90 return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;
91 }
92
99 public function getId()
100 {
101 return $this->id;
102 }
103
110 public function getVariantId()
111 {
112 return $this->variantId;
113 }
114
121 public function getKey()
122 {
123 return $this->key;
124 }
125
132 public function getSku()
133 {
134 return $this->sku;
135 }
136
143 public function getAttributes()
144 {
145 return $this->attributes;
146 }
147
154 public function getAssets()
155 {
156 return $this->assets;
157 }
158
165 public function getImages()
166 {
167 return $this->images;
168 }
169
176 public function getPublish()
177 {
178 return $this->publish;
179 }
180
185 public function withProduct(?ProductReference $product)
186 {
187 $this->product = $product;
188
189 return $this;
190 }
191
196 public function withId(?string $id)
197 {
198 $this->id = $id;
199
200 return $this;
201 }
202
207 public function withVariantId(?int $variantId)
208 {
209 $this->variantId = $variantId;
210
211 return $this;
212 }
213
218 public function withKey(?string $key)
219 {
220 $this->key = $key;
221
222 return $this;
223 }
224
229 public function withSku(?string $sku)
230 {
231 $this->sku = $sku;
232
233 return $this;
234 }
235
240 public function withAttributes(?AttributeCollection $attributes)
241 {
242 $this->attributes = $attributes;
243
244 return $this;
245 }
246
251 public function withAssets(?AssetCollection $assets)
252 {
253 $this->assets = $assets;
254
255 return $this;
256 }
257
262 public function withImages(?ImageCollection $images)
263 {
264 $this->images = $images;
265
266 return $this;
267 }
268
273 public function withPublish(?bool $publish)
274 {
275 $this->publish = $publish;
276
277 return $this;
278 }
279
285 {
286 $this->product = $product;
287
288 return $this;
289 }
290
292 {
294 $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product,
295 $this->id,
296 $this->variantId,
297 $this->key,
298 $this->sku,
299 $this->attributes,
300 $this->assets,
301 $this->images,
302 $this->publish
303 );
304 }
305
306 public static function of(): VariantCreatedMessagePayloadBuilder
307 {
308 return new self();
309 }
310}