commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
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
224 public function getPublished()
225 {
226 return $this->published;
227 }
228
235 public function getCurrent()
236 {
237 return $this->current instanceof ProductTailoringDataBuilder ? $this->current->build() : $this->current;
238 }
239
246 public function getStaged()
247 {
248 return $this->staged instanceof ProductTailoringDataBuilder ? $this->staged->build() : $this->staged;
249 }
250
257 public function getHasStagedChanges()
258 {
259 return $this->hasStagedChanges;
260 }
261
269 public function getWarnings()
270 {
271 return $this->warnings;
272 }
273
278 public function withId(?string $id)
279 {
280 $this->id = $id;
281
282 return $this;
283 }
284
289 public function withVersion(?int $version)
290 {
291 $this->version = $version;
292
293 return $this;
294 }
295
300 public function withCreatedAt(?DateTimeImmutable $createdAt)
301 {
302 $this->createdAt = $createdAt;
303
304 return $this;
305 }
306
311 public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
312 {
313 $this->lastModifiedAt = $lastModifiedAt;
314
315 return $this;
316 }
317
322 public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
323 {
324 $this->lastModifiedBy = $lastModifiedBy;
325
326 return $this;
327 }
328
333 public function withCreatedBy(?CreatedBy $createdBy)
334 {
335 $this->createdBy = $createdBy;
336
337 return $this;
338 }
339
344 public function withKey(?string $key)
345 {
346 $this->key = $key;
347
348 return $this;
349 }
350
355 public function withStore(?StoreKeyReference $store)
356 {
357 $this->store = $store;
358
359 return $this;
360 }
361
366 public function withProduct(?ProductReference $product)
367 {
368 $this->product = $product;
369
370 return $this;
371 }
372
377 public function withPublished(?bool $published)
378 {
379 $this->published = $published;
380
381 return $this;
382 }
383
388 public function withCurrent(?ProductTailoringData $current)
389 {
390 $this->current = $current;
391
392 return $this;
393 }
394
399 public function withStaged(?ProductTailoringData $staged)
400 {
401 $this->staged = $staged;
402
403 return $this;
404 }
405
410 public function withHasStagedChanges(?bool $hasStagedChanges)
411 {
412 $this->hasStagedChanges = $hasStagedChanges;
413
414 return $this;
415 }
416
421 public function withWarnings(?WarningObjectCollection $warnings)
422 {
423 $this->warnings = $warnings;
424
425 return $this;
426 }
427
432 public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
433 {
434 $this->lastModifiedBy = $lastModifiedBy;
435
436 return $this;
437 }
438
443 public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
444 {
445 $this->createdBy = $createdBy;
446
447 return $this;
448 }
449
455 {
456 $this->store = $store;
457
458 return $this;
459 }
460
466 {
467 $this->product = $product;
468
469 return $this;
470 }
471
477 {
478 $this->current = $current;
479
480 return $this;
481 }
482
488 {
489 $this->staged = $staged;
490
491 return $this;
492 }
493
494 public function build(): ProductTailoring
495 {
496 return new ProductTailoringModel(
497 $this->id,
498 $this->version,
499 $this->createdAt,
500 $this->lastModifiedAt,
501 $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
502 $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
503 $this->key,
504 $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store,
505 $this->product instanceof ProductReferenceBuilder ? $this->product->build() : $this->product,
506 $this->published,
507 $this->current instanceof ProductTailoringDataBuilder ? $this->current->build() : $this->current,
508 $this->staged instanceof ProductTailoringDataBuilder ? $this->staged->build() : $this->staged,
509 $this->hasStagedChanges,
510 $this->warnings
511 );
512 }
513
514 public static function of(): ProductTailoringBuilder
515 {
516 return new self();
517 }
518}