commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductImportModel.php
1<?php
2
3declare(strict_types=1);
10
26use stdClass;
27
31final class ProductImportModel extends JsonObjectModel implements ProductImport
32{
37 protected $key;
38
43 protected $name;
44
49 protected $productType;
50
55 protected $slug;
56
61 protected $description;
62
67 protected $categories;
68
73 protected $metaTitle;
74
80
85 protected $metaKeywords;
86
91 protected $taxCategory;
92
97 protected $searchKeywords;
98
103 protected $state;
104
109 protected $publish;
110
115 protected $priceMode;
116
117
121 public function __construct(
122 ?string $key = null,
123 ?LocalizedString $name = null,
125 ?LocalizedString $slug = null,
134 ?bool $publish = null,
135 ?string $priceMode = null
136 ) {
137 $this->key = $key;
138 $this->name = $name;
139 $this->productType = $productType;
140 $this->slug = $slug;
141 $this->description = $description;
142 $this->categories = $categories;
143 $this->metaTitle = $metaTitle;
144 $this->metaDescription = $metaDescription;
145 $this->metaKeywords = $metaKeywords;
146 $this->taxCategory = $taxCategory;
147 $this->searchKeywords = $searchKeywords;
148 $this->state = $state;
149 $this->publish = $publish;
150 $this->priceMode = $priceMode;
151 }
152
159 public function getKey()
160 {
161 if (is_null($this->key)) {
163 $data = $this->raw(self::FIELD_KEY);
164 if (is_null($data)) {
165 return null;
166 }
167 $this->key = (string) $data;
168 }
169
170 return $this->key;
171 }
172
179 public function getName()
180 {
181 if (is_null($this->name)) {
183 $data = $this->raw(self::FIELD_NAME);
184 if (is_null($data)) {
185 return null;
186 }
187
188 $this->name = LocalizedStringModel::of($data);
189 }
190
191 return $this->name;
192 }
193
203 public function getProductType()
204 {
205 if (is_null($this->productType)) {
207 $data = $this->raw(self::FIELD_PRODUCT_TYPE);
208 if (is_null($data)) {
209 return null;
210 }
211
212 $this->productType = ProductTypeKeyReferenceModel::of($data);
213 }
214
215 return $this->productType;
216 }
217
225 public function getSlug()
226 {
227 if (is_null($this->slug)) {
229 $data = $this->raw(self::FIELD_SLUG);
230 if (is_null($data)) {
231 return null;
232 }
233
234 $this->slug = LocalizedStringModel::of($data);
235 }
236
237 return $this->slug;
238 }
239
246 public function getDescription()
247 {
248 if (is_null($this->description)) {
250 $data = $this->raw(self::FIELD_DESCRIPTION);
251 if (is_null($data)) {
252 return null;
253 }
254
255 $this->description = LocalizedStringModel::of($data);
256 }
257
258 return $this->description;
259 }
260
269 public function getCategories()
270 {
271 if (is_null($this->categories)) {
273 $data = $this->raw(self::FIELD_CATEGORIES);
274 if (is_null($data)) {
275 return null;
276 }
277 $this->categories = CategoryKeyReferenceCollection::fromArray($data);
278 }
279
280 return $this->categories;
281 }
282
294 public function getMetaTitle()
295 {
296 if (is_null($this->metaTitle)) {
298 $data = $this->raw(self::FIELD_META_TITLE);
299 if (is_null($data)) {
300 return null;
301 }
302
303 $this->metaTitle = LocalizedStringModel::of($data);
304 }
305
306 return $this->metaTitle;
307 }
308
320 public function getMetaDescription()
321 {
322 if (is_null($this->metaDescription)) {
324 $data = $this->raw(self::FIELD_META_DESCRIPTION);
325 if (is_null($data)) {
326 return null;
327 }
328
329 $this->metaDescription = LocalizedStringModel::of($data);
330 }
331
333 }
334
346 public function getMetaKeywords()
347 {
348 if (is_null($this->metaKeywords)) {
350 $data = $this->raw(self::FIELD_META_KEYWORDS);
351 if (is_null($data)) {
352 return null;
353 }
354
355 $this->metaKeywords = LocalizedStringModel::of($data);
356 }
357
358 return $this->metaKeywords;
359 }
360
368 public function getTaxCategory()
369 {
370 if (is_null($this->taxCategory)) {
372 $data = $this->raw(self::FIELD_TAX_CATEGORY);
373 if (is_null($data)) {
374 return null;
375 }
376
377 $this->taxCategory = TaxCategoryKeyReferenceModel::of($data);
378 }
379
380 return $this->taxCategory;
381 }
382
405 public function getSearchKeywords()
406 {
407 if (is_null($this->searchKeywords)) {
409 $data = $this->raw(self::FIELD_SEARCH_KEYWORDS);
410 if (is_null($data)) {
411 return null;
412 }
413
414 $this->searchKeywords = SearchKeywordsModel::of($data);
415 }
416
418 }
419
427 public function getState()
428 {
429 if (is_null($this->state)) {
431 $data = $this->raw(self::FIELD_STATE);
432 if (is_null($data)) {
433 return null;
434 }
435
436 $this->state = StateKeyReferenceModel::of($data);
437 }
438
439 return $this->state;
440 }
441
448 public function getPublish()
449 {
450 if (is_null($this->publish)) {
452 $data = $this->raw(self::FIELD_PUBLISH);
453 if (is_null($data)) {
454 return null;
455 }
456 $this->publish = (bool) $data;
457 }
458
459 return $this->publish;
460 }
461
468 public function getPriceMode()
469 {
470 if (is_null($this->priceMode)) {
472 $data = $this->raw(self::FIELD_PRICE_MODE);
473 if (is_null($data)) {
474 return null;
475 }
476 $this->priceMode = (string) $data;
477 }
478
479 return $this->priceMode;
480 }
481
482
486 public function setKey(?string $key): void
487 {
488 $this->key = $key;
489 }
490
494 public function setName(?LocalizedString $name): void
495 {
496 $this->name = $name;
497 }
498
503 {
504 $this->productType = $productType;
505 }
506
510 public function setSlug(?LocalizedString $slug): void
511 {
512 $this->slug = $slug;
513 }
514
519 {
520 $this->description = $description;
521 }
522
527 {
528 $this->categories = $categories;
529 }
530
535 {
536 $this->metaTitle = $metaTitle;
537 }
538
543 {
544 $this->metaDescription = $metaDescription;
545 }
546
551 {
552 $this->metaKeywords = $metaKeywords;
553 }
554
559 {
560 $this->taxCategory = $taxCategory;
561 }
562
567 {
568 $this->searchKeywords = $searchKeywords;
569 }
570
574 public function setState(?StateKeyReference $state): void
575 {
576 $this->state = $state;
577 }
578
582 public function setPublish(?bool $publish): void
583 {
584 $this->publish = $publish;
585 }
586
590 public function setPriceMode(?string $priceMode): void
591 {
592 $this->priceMode = $priceMode;
593 }
594}
setProductType(?ProductTypeKeyReference $productType)
setTaxCategory(?TaxCategoryKeyReference $taxCategory)
__construct(?string $key=null, ?LocalizedString $name=null, ?ProductTypeKeyReference $productType=null, ?LocalizedString $slug=null, ?LocalizedString $description=null, ?CategoryKeyReferenceCollection $categories=null, ?LocalizedString $metaTitle=null, ?LocalizedString $metaDescription=null, ?LocalizedString $metaKeywords=null, ?TaxCategoryKeyReference $taxCategory=null, ?SearchKeywords $searchKeywords=null, ?StateKeyReference $state=null, ?bool $publish=null, ?string $priceMode=null)
setCategories(?CategoryKeyReferenceCollection $categories)