commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CategoryDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
22use stdClass;
23
27final class CategoryDraftBuilder implements Builder
28{
33 private $name;
34
39 private $slug;
40
45 private $description;
46
51 private $parent;
52
57 private $orderHint;
58
63 private $externalId;
64
69 private $metaTitle;
70
75 private $metaDescription;
76
81 private $metaKeywords;
82
87 private $custom;
88
93 private $assets;
94
99 private $key;
100
105 private $stores;
106
113 public function getName()
114 {
115 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
116 }
117
126 public function getSlug()
127 {
128 return $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug;
129 }
130
137 public function getDescription()
138 {
139 return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
140 }
141
149 public function getParent()
150 {
151 return $this->parent instanceof CategoryResourceIdentifierBuilder ? $this->parent->build() : $this->parent;
152 }
153
161 public function getOrderHint()
162 {
163 return $this->orderHint;
164 }
165
172 public function getExternalId()
173 {
174 return $this->externalId;
175 }
176
183 public function getMetaTitle()
184 {
185 return $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle;
186 }
187
194 public function getMetaDescription()
195 {
196 return $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription;
197 }
198
205 public function getMetaKeywords()
206 {
207 return $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords;
208 }
209
216 public function getCustom()
217 {
218 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
219 }
220
227 public function getAssets()
228 {
229 return $this->assets;
230 }
231
239 public function getKey()
240 {
241 return $this->key;
242 }
243
259 public function getStores()
260 {
261 return $this->stores;
262 }
263
268 public function withName(?LocalizedString $name)
269 {
270 $this->name = $name;
271
272 return $this;
273 }
274
279 public function withSlug(?LocalizedString $slug)
280 {
281 $this->slug = $slug;
282
283 return $this;
284 }
285
290 public function withDescription(?LocalizedString $description)
291 {
292 $this->description = $description;
293
294 return $this;
295 }
296
301 public function withParent(?CategoryResourceIdentifier $parent)
302 {
303 $this->parent = $parent;
304
305 return $this;
306 }
307
312 public function withOrderHint(?string $orderHint)
313 {
314 $this->orderHint = $orderHint;
315
316 return $this;
317 }
318
323 public function withExternalId(?string $externalId)
324 {
325 $this->externalId = $externalId;
326
327 return $this;
328 }
329
334 public function withMetaTitle(?LocalizedString $metaTitle)
335 {
336 $this->metaTitle = $metaTitle;
337
338 return $this;
339 }
340
345 public function withMetaDescription(?LocalizedString $metaDescription)
346 {
347 $this->metaDescription = $metaDescription;
348
349 return $this;
350 }
351
356 public function withMetaKeywords(?LocalizedString $metaKeywords)
357 {
358 $this->metaKeywords = $metaKeywords;
359
360 return $this;
361 }
362
367 public function withCustom(?CustomFieldsDraft $custom)
368 {
369 $this->custom = $custom;
370
371 return $this;
372 }
373
378 public function withAssets(?AssetDraftCollection $assets)
379 {
380 $this->assets = $assets;
381
382 return $this;
383 }
384
389 public function withKey(?string $key)
390 {
391 $this->key = $key;
392
393 return $this;
394 }
395
401 {
402 $this->stores = $stores;
403
404 return $this;
405 }
406
412 {
413 $this->name = $name;
414
415 return $this;
416 }
417
423 {
424 $this->slug = $slug;
425
426 return $this;
427 }
428
433 public function withDescriptionBuilder(?LocalizedStringBuilder $description)
434 {
435 $this->description = $description;
436
437 return $this;
438 }
439
445 {
446 $this->parent = $parent;
447
448 return $this;
449 }
450
455 public function withMetaTitleBuilder(?LocalizedStringBuilder $metaTitle)
456 {
457 $this->metaTitle = $metaTitle;
458
459 return $this;
460 }
461
466 public function withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
467 {
468 $this->metaDescription = $metaDescription;
469
470 return $this;
471 }
472
477 public function withMetaKeywordsBuilder(?LocalizedStringBuilder $metaKeywords)
478 {
479 $this->metaKeywords = $metaKeywords;
480
481 return $this;
482 }
483
489 {
490 $this->custom = $custom;
491
492 return $this;
493 }
494
495 public function build(): CategoryDraft
496 {
497 return new CategoryDraftModel(
498 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
499 $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug,
500 $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
501 $this->parent instanceof CategoryResourceIdentifierBuilder ? $this->parent->build() : $this->parent,
502 $this->orderHint,
503 $this->externalId,
504 $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle,
505 $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription,
506 $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords,
507 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
508 $this->assets,
509 $this->key,
510 $this->stores
511 );
512 }
513
514 public static function of(): CategoryDraftBuilder
515 {
516 return new self();
517 }
518}
withStores(?StoreResourceIdentifierCollection $stores)
withDescriptionBuilder(?LocalizedStringBuilder $description)
withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
withParentBuilder(?CategoryResourceIdentifierBuilder $parent)
withMetaKeywordsBuilder(?LocalizedStringBuilder $metaKeywords)