commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
CategoryImportBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
25 use stdClass;
26 
30 final class CategoryImportBuilder implements Builder
31 {
36  private $key;
37 
42  private $name;
43 
48  private $slug;
49 
54  private $description;
55 
60  private $parent;
61 
66  private $orderHint;
67 
72  private $externalId;
73 
78  private $metaTitle;
79 
84  private $metaDescription;
85 
90  private $metaKeywords;
91 
96  private $assets;
97 
102  private $custom;
103 
110  public function getKey()
111  {
112  return $this->key;
113  }
114 
121  public function getName()
122  {
123  return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
124  }
125 
133  public function getSlug()
134  {
135  return $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug;
136  }
137 
144  public function getDescription()
145  {
146  return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
147  }
148 
157  public function getParent()
158  {
159  return $this->parent instanceof CategoryKeyReferenceBuilder ? $this->parent->build() : $this->parent;
160  }
161 
168  public function getOrderHint()
169  {
170  return $this->orderHint;
171  }
172 
179  public function getExternalId()
180  {
181  return $this->externalId;
182  }
183 
190  public function getMetaTitle()
191  {
192  return $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle;
193  }
194 
201  public function getMetaDescription()
202  {
203  return $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription;
204  }
205 
212  public function getMetaKeywords()
213  {
214  return $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords;
215  }
216 
221  public function getAssets()
222  {
223  return $this->assets;
224  }
225 
232  public function getCustom()
233  {
234  return $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom;
235  }
236 
241  public function withKey(?string $key)
242  {
243  $this->key = $key;
244 
245  return $this;
246  }
247 
252  public function withName(?LocalizedString $name)
253  {
254  $this->name = $name;
255 
256  return $this;
257  }
258 
263  public function withSlug(?LocalizedString $slug)
264  {
265  $this->slug = $slug;
266 
267  return $this;
268  }
269 
274  public function withDescription(?LocalizedString $description)
275  {
276  $this->description = $description;
277 
278  return $this;
279  }
280 
285  public function withParent(?CategoryKeyReference $parent)
286  {
287  $this->parent = $parent;
288 
289  return $this;
290  }
291 
296  public function withOrderHint(?string $orderHint)
297  {
298  $this->orderHint = $orderHint;
299 
300  return $this;
301  }
302 
307  public function withExternalId(?string $externalId)
308  {
309  $this->externalId = $externalId;
310 
311  return $this;
312  }
313 
318  public function withMetaTitle(?LocalizedString $metaTitle)
319  {
320  $this->metaTitle = $metaTitle;
321 
322  return $this;
323  }
324 
329  public function withMetaDescription(?LocalizedString $metaDescription)
330  {
331  $this->metaDescription = $metaDescription;
332 
333  return $this;
334  }
335 
340  public function withMetaKeywords(?LocalizedString $metaKeywords)
341  {
342  $this->metaKeywords = $metaKeywords;
343 
344  return $this;
345  }
346 
351  public function withAssets(?AssetCollection $assets)
352  {
353  $this->assets = $assets;
354 
355  return $this;
356  }
357 
362  public function withCustom(?Custom $custom)
363  {
364  $this->custom = $custom;
365 
366  return $this;
367  }
368 
373  public function withNameBuilder(?LocalizedStringBuilder $name)
374  {
375  $this->name = $name;
376 
377  return $this;
378  }
379 
384  public function withSlugBuilder(?LocalizedStringBuilder $slug)
385  {
386  $this->slug = $slug;
387 
388  return $this;
389  }
390 
395  public function withDescriptionBuilder(?LocalizedStringBuilder $description)
396  {
397  $this->description = $description;
398 
399  return $this;
400  }
401 
407  {
408  $this->parent = $parent;
409 
410  return $this;
411  }
412 
417  public function withMetaTitleBuilder(?LocalizedStringBuilder $metaTitle)
418  {
419  $this->metaTitle = $metaTitle;
420 
421  return $this;
422  }
423 
428  public function withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
429  {
430  $this->metaDescription = $metaDescription;
431 
432  return $this;
433  }
434 
439  public function withMetaKeywordsBuilder(?LocalizedStringBuilder $metaKeywords)
440  {
441  $this->metaKeywords = $metaKeywords;
442 
443  return $this;
444  }
445 
450  public function withCustomBuilder(?CustomBuilder $custom)
451  {
452  $this->custom = $custom;
453 
454  return $this;
455  }
456 
457  public function build(): CategoryImport
458  {
459  return new CategoryImportModel(
460  $this->key,
461  $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
462  $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug,
463  $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
464  $this->parent instanceof CategoryKeyReferenceBuilder ? $this->parent->build() : $this->parent,
465  $this->orderHint,
466  $this->externalId,
467  $this->metaTitle instanceof LocalizedStringBuilder ? $this->metaTitle->build() : $this->metaTitle,
468  $this->metaDescription instanceof LocalizedStringBuilder ? $this->metaDescription->build() : $this->metaDescription,
469  $this->metaKeywords instanceof LocalizedStringBuilder ? $this->metaKeywords->build() : $this->metaKeywords,
470  $this->assets,
471  $this->custom instanceof CustomBuilder ? $this->custom->build() : $this->custom
472  );
473  }
474 
475  public static function of(): CategoryImportBuilder
476  {
477  return new self();
478  }
479 }
withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)