commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
ProductTailoringBuilder.php
1<?php
2
3declare(strict_types=1);
10
27use DateTimeImmutable;
28use stdClass;
29
33final class ProductTailoringBuilder implements Builder
34{
39 private $id;
40
45 private $version;
46
51 private $createdAt;
52
57 private $lastModifiedAt;
58
63 private $lastModifiedBy;
64
69 private $createdBy;
70
75 private $key;
76
81 private $store;
82
87 private $product;
88
93 private $published;
94
99 private $current;
100
105 private $staged;
106
111 private $hasStagedChanges;
112
117 private $warnings;
118
125 public function getId()
126 {
127 return $this->id;
128 }
129
136 public function getVersion()
137 {
138 return $this->version;
139 }
140
147 public function getCreatedAt()
148 {
149 return $this->createdAt;
150 }
151
158 public function getLastModifiedAt()
159 {
160 return $this->lastModifiedAt;
161 }
162
169 public function getLastModifiedBy()
170 {
171 return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
172 }
173
180 public function getCreatedBy()
181 {
182 return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
183 }
184
191 public function getKey()
192 {
193 return $this->key;
194 }
195
202 public function getStore()
203 {
204 return $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store;
205 }
206
213 public function getProduct()
214 {
215 return $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product;
216 }
217
226 public function getPublished()
227 {
228 return $this->published;
229 }
230
237 public function getCurrent()
238 {
239 return $this->current instanceof ProductTailoringDataBuilder ? $this->current->build() : $this->current;
240 }
241
248 public function getStaged()
249 {
250 return $this->staged instanceof ProductTailoringDataBuilder ? $this->staged->build() : $this->staged;
251 }
252
259 public function getHasStagedChanges()
260 {
261 return $this->hasStagedChanges;
262 }
263
271 public function getWarnings()
272 {
273 return $this->warnings;
274 }
275
280 public function withId(?string $id)
281 {
282 $this->id = $id;
283
284 return $this;
285 }
286
291 public function withVersion(?int $version)
292 {
293 $this->version = $version;
294
295 return $this;
296 }
297
302 public function withCreatedAt(?DateTimeImmutable $createdAt)
303 {
304 $this->createdAt = $createdAt;
305
306 return $this;
307 }
308
313 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
314 {
315 $this->lastModifiedAt = $lastModifiedAt;
316
317 return $this;
318 }
319
324 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
325 {
326 $this->lastModifiedBy = $lastModifiedBy;
327
328 return $this;
329 }
330
335 public function withCreatedBy(?CreatedBy $createdBy)
336 {
337 $this->createdBy = $createdBy;
338
339 return $this;
340 }
341
346 public function withKey(?string $key)
347 {
348 $this->key = $key;
349
350 return $this;
351 }
352
357 public function withStore(?StoreKeyReference $store)
358 {
359 $this->store = $store;
360
361 return $this;
362 }
363
368 public function withProduct(?ProductReference $product)
369 {
370 $this->product = $product;
371
372 return $this;
373 }
374
379 public function withPublished(?bool $published)
380 {
381 $this->published = $published;
382
383 return $this;
384 }
385
390 public function withCurrent(?ProductTailoringData $current)
391 {
392 $this->current = $current;
393
394 return $this;
395 }
396
401 public function withStaged(?ProductTailoringData $staged)
402 {
403 $this->staged = $staged;
404
405 return $this;
406 }
407
412 public function withHasStagedChanges(?bool $hasStagedChanges)
413 {
414 $this->hasStagedChanges = $hasStagedChanges;
415
416 return $this;
417 }
418
423 public function withWarnings(?WarningObjectCollection $warnings)
424 {
425 $this->warnings = $warnings;
426
427 return $this;
428 }
429
434 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
435 {
436 $this->lastModifiedBy = $lastModifiedBy;
437
438 return $this;
439 }
440
445 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
446 {
447 $this->createdBy = $createdBy;
448
449 return $this;
450 }
451
457 {
458 $this->store = $store;
459
460 return $this;
461 }
462
468 {
469 $this->product = $product;
470
471 return $this;
472 }
473
479 {
480 $this->current = $current;
481
482 return $this;
483 }
484
490 {
491 $this->staged = $staged;
492
493 return $this;
494 }
495
496 public function build(): ProductTailoring
497 {
498 return new ProductTailoringModel(
499 $this->id,
500 $this->version,
501 $this->createdAt,
502 $this->lastModifiedAt,
503 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
504 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
505 $this->key,
506 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
507 $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product,
508 $this->published,
509 $this->current instanceof ProductTailoringDataBuilder ? $this->current->build() : $this->current,
510 $this->staged instanceof ProductTailoringDataBuilder ? $this->staged->build() : $this->staged,
511 $this->hasStagedChanges,
512 $this->warnings
513 );
514 }
515
516 public static function of(): ProductTailoringBuilder
517 {
518 return new self();
519 }
520}