commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Product
ProductDataBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Product
;
10
11
use
Commercetools\Api\Models\Category\CategoryReferenceCollection
;
12
use
Commercetools\Api\Models\Common\LocalizedString
;
13
use
Commercetools\Api\Models\Common\LocalizedStringBuilder
;
14
use
Commercetools\Base\Builder
;
15
use
Commercetools\Base\DateTimeImmutableCollection
;
16
use
Commercetools\Base\JsonObject
;
17
use
Commercetools\Base\JsonObjectModel
;
18
use
Commercetools\Base\MapperFactory
;
19
use stdClass;
20
24
final
class
ProductDataBuilder
implements
Builder
25
{
30
private
$name;
31
36
private
$categories;
37
42
private
$categoryOrderHints;
43
48
private
$description;
49
54
private
$slug;
55
60
private
$metaTitle;
61
66
private
$metaDescription;
67
72
private
$metaKeywords;
73
78
private
$masterVariant;
79
84
private
$variants;
85
90
private
$searchKeywords;
91
98
public
function
getName
()
99
{
100
return
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name;
101
}
102
109
public
function
getCategories
()
110
{
111
return
$this->categories;
112
}
113
120
public
function
getCategoryOrderHints
()
121
{
122
return
$this->categoryOrderHints instanceof
CategoryOrderHintsBuilder
? $this->categoryOrderHints->
build
() : $this->categoryOrderHints;
123
}
124
131
public
function
getDescription
()
132
{
133
return
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description;
134
}
135
144
public
function
getSlug
()
145
{
146
return
$this->slug instanceof
LocalizedStringBuilder
? $this->slug->
build
() : $this->slug;
147
}
148
155
public
function
getMetaTitle
()
156
{
157
return
$this->metaTitle instanceof
LocalizedStringBuilder
? $this->metaTitle->
build
() : $this->metaTitle;
158
}
159
166
public
function
getMetaDescription
()
167
{
168
return
$this->metaDescription instanceof
LocalizedStringBuilder
? $this->metaDescription->
build
() : $this->metaDescription;
169
}
170
177
public
function
getMetaKeywords
()
178
{
179
return
$this->metaKeywords instanceof
LocalizedStringBuilder
? $this->metaKeywords->
build
() : $this->metaKeywords;
180
}
181
188
public
function
getMasterVariant
()
189
{
190
return
$this->masterVariant instanceof
ProductVariantBuilder
? $this->masterVariant->
build
() : $this->masterVariant;
191
}
192
199
public
function
getVariants
()
200
{
201
return
$this->variants;
202
}
203
210
public
function
getSearchKeywords
()
211
{
212
return
$this->searchKeywords instanceof
SearchKeywordsBuilder
? $this->searchKeywords->
build
() : $this->searchKeywords;
213
}
214
219
public
function
withName
(?
LocalizedString
$name)
220
{
221
$this->name = $name;
222
223
return
$this;
224
}
225
230
public
function
withCategories
(?
CategoryReferenceCollection
$categories)
231
{
232
$this->categories = $categories;
233
234
return
$this;
235
}
236
241
public
function
withCategoryOrderHints
(?
CategoryOrderHints
$categoryOrderHints)
242
{
243
$this->categoryOrderHints = $categoryOrderHints;
244
245
return
$this;
246
}
247
252
public
function
withDescription
(?
LocalizedString
$description)
253
{
254
$this->description = $description;
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
withMetaTitle
(?
LocalizedString
$metaTitle)
275
{
276
$this->metaTitle = $metaTitle;
277
278
return
$this;
279
}
280
285
public
function
withMetaDescription
(?
LocalizedString
$metaDescription)
286
{
287
$this->metaDescription = $metaDescription;
288
289
return
$this;
290
}
291
296
public
function
withMetaKeywords
(?
LocalizedString
$metaKeywords)
297
{
298
$this->metaKeywords = $metaKeywords;
299
300
return
$this;
301
}
302
307
public
function
withMasterVariant
(?
ProductVariant
$masterVariant)
308
{
309
$this->masterVariant = $masterVariant;
310
311
return
$this;
312
}
313
318
public
function
withVariants
(?
ProductVariantCollection
$variants)
319
{
320
$this->variants = $variants;
321
322
return
$this;
323
}
324
329
public
function
withSearchKeywords
(?
SearchKeywords
$searchKeywords)
330
{
331
$this->searchKeywords = $searchKeywords;
332
333
return
$this;
334
}
335
340
public
function
withNameBuilder
(?
LocalizedStringBuilder
$name)
341
{
342
$this->name = $name;
343
344
return
$this;
345
}
346
351
public
function
withCategoryOrderHintsBuilder
(?
CategoryOrderHintsBuilder
$categoryOrderHints)
352
{
353
$this->categoryOrderHints = $categoryOrderHints;
354
355
return
$this;
356
}
357
362
public
function
withDescriptionBuilder
(?
LocalizedStringBuilder
$description)
363
{
364
$this->description = $description;
365
366
return
$this;
367
}
368
373
public
function
withSlugBuilder
(?
LocalizedStringBuilder
$slug)
374
{
375
$this->slug = $slug;
376
377
return
$this;
378
}
379
384
public
function
withMetaTitleBuilder
(?
LocalizedStringBuilder
$metaTitle)
385
{
386
$this->metaTitle = $metaTitle;
387
388
return
$this;
389
}
390
395
public
function
withMetaDescriptionBuilder
(?
LocalizedStringBuilder
$metaDescription)
396
{
397
$this->metaDescription = $metaDescription;
398
399
return
$this;
400
}
401
406
public
function
withMetaKeywordsBuilder
(?
LocalizedStringBuilder
$metaKeywords)
407
{
408
$this->metaKeywords = $metaKeywords;
409
410
return
$this;
411
}
412
417
public
function
withMasterVariantBuilder
(?
ProductVariantBuilder
$masterVariant)
418
{
419
$this->masterVariant = $masterVariant;
420
421
return
$this;
422
}
423
428
public
function
withSearchKeywordsBuilder
(?
SearchKeywordsBuilder
$searchKeywords)
429
{
430
$this->searchKeywords = $searchKeywords;
431
432
return
$this;
433
}
434
435
public
function
build
():
ProductData
436
{
437
return
new
ProductDataModel
(
438
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name,
439
$this->categories,
440
$this->categoryOrderHints instanceof
CategoryOrderHintsBuilder
? $this->categoryOrderHints->
build
() : $this->categoryOrderHints,
441
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description,
442
$this->slug instanceof
LocalizedStringBuilder
? $this->slug->
build
() : $this->slug,
443
$this->metaTitle instanceof
LocalizedStringBuilder
? $this->metaTitle->
build
() : $this->metaTitle,
444
$this->metaDescription instanceof
LocalizedStringBuilder
? $this->metaDescription->
build
() : $this->metaDescription,
445
$this->metaKeywords instanceof
LocalizedStringBuilder
? $this->metaKeywords->
build
() : $this->metaKeywords,
446
$this->masterVariant instanceof
ProductVariantBuilder
? $this->masterVariant->
build
() : $this->masterVariant,
447
$this->variants,
448
$this->searchKeywords instanceof
SearchKeywordsBuilder
? $this->searchKeywords->
build
() : $this->searchKeywords
449
);
450
}
451
452
public
static
function
of
():
ProductDataBuilder
453
{
454
return
new
self
();
455
}
456
}
Commercetools\Api\Models\Category\CategoryReferenceCollection
Definition
CategoryReferenceCollection.php:22
Commercetools\Api\Models\Common\LocalizedStringBuilder
Definition
LocalizedStringBuilder.php:20
Commercetools\Api\Models\Common\LocalizedStringBuilder\build
build()
Definition
LocalizedStringBuilder.php:42
Commercetools\Api\Models\Product\CategoryOrderHintsBuilder
Definition
CategoryOrderHintsBuilder.php:20
Commercetools\Api\Models\Product\CategoryOrderHintsBuilder\build
build()
Definition
CategoryOrderHintsBuilder.php:42
Commercetools\Api\Models\Product\ProductDataBuilder
Definition
ProductDataBuilder.php:25
Commercetools\Api\Models\Product\ProductDataBuilder\of
static of()
Definition
ProductDataBuilder.php:452
Commercetools\Api\Models\Product\ProductDataBuilder\withCategories
withCategories(?CategoryReferenceCollection $categories)
Definition
ProductDataBuilder.php:230
Commercetools\Api\Models\Product\ProductDataBuilder\withCategoryOrderHintsBuilder
withCategoryOrderHintsBuilder(?CategoryOrderHintsBuilder $categoryOrderHints)
Definition
ProductDataBuilder.php:351
Commercetools\Api\Models\Product\ProductDataBuilder\getMetaTitle
getMetaTitle()
Definition
ProductDataBuilder.php:155
Commercetools\Api\Models\Product\ProductDataBuilder\getVariants
getVariants()
Definition
ProductDataBuilder.php:199
Commercetools\Api\Models\Product\ProductDataBuilder\withMasterVariantBuilder
withMasterVariantBuilder(?ProductVariantBuilder $masterVariant)
Definition
ProductDataBuilder.php:417
Commercetools\Api\Models\Product\ProductDataBuilder\getMetaDescription
getMetaDescription()
Definition
ProductDataBuilder.php:166
Commercetools\Api\Models\Product\ProductDataBuilder\withMetaTitle
withMetaTitle(?LocalizedString $metaTitle)
Definition
ProductDataBuilder.php:274
Commercetools\Api\Models\Product\ProductDataBuilder\withVariants
withVariants(?ProductVariantCollection $variants)
Definition
ProductDataBuilder.php:318
Commercetools\Api\Models\Product\ProductDataBuilder\withName
withName(?LocalizedString $name)
Definition
ProductDataBuilder.php:219
Commercetools\Api\Models\Product\ProductDataBuilder\withDescription
withDescription(?LocalizedString $description)
Definition
ProductDataBuilder.php:252
Commercetools\Api\Models\Product\ProductDataBuilder\withDescriptionBuilder
withDescriptionBuilder(?LocalizedStringBuilder $description)
Definition
ProductDataBuilder.php:362
Commercetools\Api\Models\Product\ProductDataBuilder\getCategories
getCategories()
Definition
ProductDataBuilder.php:109
Commercetools\Api\Models\Product\ProductDataBuilder\withMetaDescription
withMetaDescription(?LocalizedString $metaDescription)
Definition
ProductDataBuilder.php:285
Commercetools\Api\Models\Product\ProductDataBuilder\withSlug
withSlug(?LocalizedString $slug)
Definition
ProductDataBuilder.php:263
Commercetools\Api\Models\Product\ProductDataBuilder\getCategoryOrderHints
getCategoryOrderHints()
Definition
ProductDataBuilder.php:120
Commercetools\Api\Models\Product\ProductDataBuilder\withSearchKeywords
withSearchKeywords(?SearchKeywords $searchKeywords)
Definition
ProductDataBuilder.php:329
Commercetools\Api\Models\Product\ProductDataBuilder\build
build()
Definition
ProductDataBuilder.php:435
Commercetools\Api\Models\Product\ProductDataBuilder\withSearchKeywordsBuilder
withSearchKeywordsBuilder(?SearchKeywordsBuilder $searchKeywords)
Definition
ProductDataBuilder.php:428
Commercetools\Api\Models\Product\ProductDataBuilder\withMetaKeywords
withMetaKeywords(?LocalizedString $metaKeywords)
Definition
ProductDataBuilder.php:296
Commercetools\Api\Models\Product\ProductDataBuilder\withMetaTitleBuilder
withMetaTitleBuilder(?LocalizedStringBuilder $metaTitle)
Definition
ProductDataBuilder.php:384
Commercetools\Api\Models\Product\ProductDataBuilder\withMasterVariant
withMasterVariant(?ProductVariant $masterVariant)
Definition
ProductDataBuilder.php:307
Commercetools\Api\Models\Product\ProductDataBuilder\withCategoryOrderHints
withCategoryOrderHints(?CategoryOrderHints $categoryOrderHints)
Definition
ProductDataBuilder.php:241
Commercetools\Api\Models\Product\ProductDataBuilder\getMetaKeywords
getMetaKeywords()
Definition
ProductDataBuilder.php:177
Commercetools\Api\Models\Product\ProductDataBuilder\getName
getName()
Definition
ProductDataBuilder.php:98
Commercetools\Api\Models\Product\ProductDataBuilder\getMasterVariant
getMasterVariant()
Definition
ProductDataBuilder.php:188
Commercetools\Api\Models\Product\ProductDataBuilder\withMetaDescriptionBuilder
withMetaDescriptionBuilder(?LocalizedStringBuilder $metaDescription)
Definition
ProductDataBuilder.php:395
Commercetools\Api\Models\Product\ProductDataBuilder\getSlug
getSlug()
Definition
ProductDataBuilder.php:144
Commercetools\Api\Models\Product\ProductDataBuilder\getSearchKeywords
getSearchKeywords()
Definition
ProductDataBuilder.php:210
Commercetools\Api\Models\Product\ProductDataBuilder\withSlugBuilder
withSlugBuilder(?LocalizedStringBuilder $slug)
Definition
ProductDataBuilder.php:373
Commercetools\Api\Models\Product\ProductDataBuilder\withMetaKeywordsBuilder
withMetaKeywordsBuilder(?LocalizedStringBuilder $metaKeywords)
Definition
ProductDataBuilder.php:406
Commercetools\Api\Models\Product\ProductDataBuilder\withNameBuilder
withNameBuilder(?LocalizedStringBuilder $name)
Definition
ProductDataBuilder.php:340
Commercetools\Api\Models\Product\ProductDataBuilder\getDescription
getDescription()
Definition
ProductDataBuilder.php:131
Commercetools\Api\Models\Product\ProductDataModel
Definition
ProductDataModel.php:24
Commercetools\Api\Models\Product\ProductVariantBuilder
Definition
ProductVariantBuilder.php:29
Commercetools\Api\Models\Product\ProductVariantBuilder\build
build()
Definition
ProductVariantBuilder.php:408
Commercetools\Api\Models\Product\ProductVariantCollection
Definition
ProductVariantCollection.php:22
Commercetools\Api\Models\Product\SearchKeywordsBuilder
Definition
SearchKeywordsBuilder.php:20
Commercetools\Api\Models\Product\SearchKeywordsBuilder\build
build()
Definition
SearchKeywordsBuilder.php:42
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Common\LocalizedString
Definition
LocalizedString.php:14
Commercetools\Api\Models\Product\CategoryOrderHints
Definition
CategoryOrderHints.php:14
Commercetools\Api\Models\Product\ProductData
Definition
ProductData.php:17
Commercetools\Api\Models\Product\ProductVariant
Definition
ProductVariant.php:20
Commercetools\Api\Models\Product\SearchKeywords
Definition
SearchKeywords.php:14
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Product
Definition
AttributeAccessor.php:4
Generated by
1.9.8