commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductImportBuilder.php
1<?php
2
3declare(strict_types=1);
10
28use stdClass;
29
33final class ProductImportBuilder implements Builder
34{
39 private $key;
40
45 private $name;
46
51 private $productType;
52
57 private $slug;
58
63 private $description;
64
69 private $categories;
70
75 private $attributes;
76
81 private $metaTitle;
82
87 private $metaDescription;
88
93 private $metaKeywords;
94
99 private $taxCategory;
100
105 private $searchKeywords;
106
111 private $state;
112
117 private $publish;
118
123 private $priceMode;
124
131 public function getKey()
132 {
133 return $this->key;
134 }
135
142 public function getName()
143 {
144 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
145 }
146
153 public function getProductType()
154 {
155 return $this->productType instanceof ProductTypeKeyReferenceBuilder ? $this->productType->build() : $this->productType;
156 }
157
164 public function getSlug()
165 {
166 return $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug;
167 }
168
175 public function getDescription()
176 {
177 return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
178 }
179
186 public function getCategories()
187 {
188 return $this->categories;
189 }
190
195 public function getAttributes()
196 {
197 return $this->attributes;
198 }
199
206 public function getMetaTitle()
207 {
208 return $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle;
209 }
210
217 public function getMetaDescription()
218 {
219 return $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription;
220 }
221
228 public function getMetaKeywords()
229 {
230 return $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords;
231 }
232
239 public function getTaxCategory()
240 {
241 return $this->taxCategory instanceof TaxCategoryKeyReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory;
242 }
243
250 public function getSearchKeywords()
251 {
252 return $this->searchKeywords instanceof SearchKeywordsBuilder ? $this->searchKeywords->build() : $this->searchKeywords;
253 }
254
261 public function getState()
262 {
263 return $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state;
264 }
265
272 public function getPublish()
273 {
274 return $this->publish;
275 }
276
283 public function getPriceMode()
284 {
285 return $this->priceMode;
286 }
287
292 public function withKey(?string $key)
293 {
294 $this->key = $key;
295
296 return $this;
297 }
298
303 public function withName(?LocalizedString $name)
304 {
305 $this->name = $name;
306
307 return $this;
308 }
309
314 public function withProductType(?ProductTypeKeyReference $productType)
315 {
316 $this->productType = $productType;
317
318 return $this;
319 }
320
325 public function withSlug(?LocalizedString $slug)
326 {
327 $this->slug = $slug;
328
329 return $this;
330 }
331
336 public function withDescription(?LocalizedString $description)
337 {
338 $this->description = $description;
339
340 return $this;
341 }
342
347 public function withCategories(?CategoryKeyReferenceCollection $categories)
348 {
349 $this->categories = $categories;
350
351 return $this;
352 }
353
358 public function withAttributes(?AttributeCollection $attributes)
359 {
360 $this->attributes = $attributes;
361
362 return $this;
363 }
364
369 public function withMetaTitle(?LocalizedString $metaTitle)
370 {
371 $this->metaTitle = $metaTitle;
372
373 return $this;
374 }
375
380 public function withMetaDescription(?LocalizedString $metaDescription)
381 {
382 $this->metaDescription = $metaDescription;
383
384 return $this;
385 }
386
391 public function withMetaKeywords(?LocalizedString $metaKeywords)
392 {
393 $this->metaKeywords = $metaKeywords;
394
395 return $this;
396 }
397
402 public function withTaxCategory(?TaxCategoryKeyReference $taxCategory)
403 {
404 $this->taxCategory = $taxCategory;
405
406 return $this;
407 }
408
413 public function withSearchKeywords(?SearchKeywords $searchKeywords)
414 {
415 $this->searchKeywords = $searchKeywords;
416
417 return $this;
418 }
419
424 public function withState(?StateKeyReference $state)
425 {
426 $this->state = $state;
427
428 return $this;
429 }
430
435 public function withPublish(?bool $publish)
436 {
437 $this->publish = $publish;
438
439 return $this;
440 }
441
446 public function withPriceMode(?string $priceMode)
447 {
448 $this->priceMode = $priceMode;
449
450 return $this;
451 }
452
458 {
459 $this->name = $name;
460
461 return $this;
462 }
463
469 {
470 $this->productType = $productType;
471
472 return $this;
473 }
474
480 {
481 $this->slug = $slug;
482
483 return $this;
484 }
485
490 public function withDescriptionBuilder(?LocalizedStringBuilder $description)
491 {
492 $this->description = $description;
493
494 return $this;
495 }
496
501 public function withMetaTitleBuilder(?LocalizedStringBuilder $metaTitle)
502 {
503 $this->metaTitle = $metaTitle;
504
505 return $this;
506 }
507
512 public function withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
513 {
514 $this->metaDescription = $metaDescription;
515
516 return $this;
517 }
518
523 public function withMetaKeywordsBuilder(?LocalizedStringBuilder $metaKeywords)
524 {
525 $this->metaKeywords = $metaKeywords;
526
527 return $this;
528 }
529
535 {
536 $this->taxCategory = $taxCategory;
537
538 return $this;
539 }
540
545 public function withSearchKeywordsBuilder(?SearchKeywordsBuilder $searchKeywords)
546 {
547 $this->searchKeywords = $searchKeywords;
548
549 return $this;
550 }
551
557 {
558 $this->state = $state;
559
560 return $this;
561 }
562
563 public function build(): ProductImport
564 {
565 return new ProductImportModel(
566 $this->key,
567 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
568 $this->productType instanceof ProductTypeKeyReferenceBuilder ? $this->productType->build() : $this->productType,
569 $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug,
570 $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
571 $this->categories,
572 $this->attributes,
573 $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle,
574 $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription,
575 $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords,
576 $this->taxCategory instanceof TaxCategoryKeyReferenceBuilder ? $this->taxCategory->build() : $this->taxCategory,
577 $this->searchKeywords instanceof SearchKeywordsBuilder ? $this->searchKeywords->build() : $this->searchKeywords,
578 $this->state instanceof StateKeyReferenceBuilder ? $this->state->build() : $this->state,
579 $this->publish,
580 $this->priceMode
581 );
582 }
583
584 public static function of(): ProductImportBuilder
585 {
586 return new self();
587 }
588}
withMetaKeywordsBuilder(?LocalizedStringBuilder $metaKeywords)
withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
withSearchKeywordsBuilder(?SearchKeywordsBuilder $searchKeywords)
withTaxCategoryBuilder(?TaxCategoryKeyReferenceBuilder $taxCategory)
withCategories(?CategoryKeyReferenceCollection $categories)
withProductTypeBuilder(?ProductTypeKeyReferenceBuilder $productType)