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
ProductSelection
ProductSelectionBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSelection
;
10
11
use
Commercetools\Api\Models\Common\BaseResource
;
12
use
Commercetools\Api\Models\Common\BaseResourceBuilder
;
13
use
Commercetools\Api\Models\Common\CreatedBy
;
14
use
Commercetools\Api\Models\Common\CreatedByBuilder
;
15
use
Commercetools\Api\Models\Common\LastModifiedBy
;
16
use
Commercetools\Api\Models\Common\LastModifiedByBuilder
;
17
use
Commercetools\Api\Models\Common\LocalizedString
;
18
use
Commercetools\Api\Models\Common\LocalizedStringBuilder
;
19
use
Commercetools\Api\Models\Type\CustomFields
;
20
use
Commercetools\Api\Models\Type\CustomFieldsBuilder
;
21
use
Commercetools\Base\Builder
;
22
use
Commercetools\Base\DateTimeImmutableCollection
;
23
use
Commercetools\Base\JsonObject
;
24
use
Commercetools\Base\JsonObjectModel
;
25
use
Commercetools\Base\MapperFactory
;
26
use DateTimeImmutable;
27
use stdClass;
28
32
final
class
ProductSelectionBuilder
implements
Builder
33
{
38
private
$id;
39
44
private
$version;
45
50
private
$createdAt;
51
56
private
$lastModifiedAt;
57
62
private
$lastModifiedBy;
63
68
private
$createdBy;
69
74
private
$key;
75
80
private
$name;
81
86
private
$productCount;
87
92
private
$mode;
93
98
private
$custom;
99
106
public
function
getId
()
107
{
108
return
$this->id;
109
}
110
117
public
function
getVersion
()
118
{
119
return
$this->version;
120
}
121
128
public
function
getCreatedAt
()
129
{
130
return
$this->createdAt;
131
}
132
139
public
function
getLastModifiedAt
()
140
{
141
return
$this->lastModifiedAt;
142
}
143
150
public
function
getLastModifiedBy
()
151
{
152
return
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy;
153
}
154
161
public
function
getCreatedBy
()
162
{
163
return
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy;
164
}
165
172
public
function
getKey
()
173
{
174
return
$this->key;
175
}
176
183
public
function
getName
()
184
{
185
return
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name;
186
}
187
194
public
function
getProductCount
()
195
{
196
return
$this->productCount;
197
}
198
206
public
function
getMode
()
207
{
208
return
$this->mode;
209
}
210
217
public
function
getCustom
()
218
{
219
return
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom;
220
}
221
226
public
function
withId
(?
string
$id)
227
{
228
$this->
id
= $id;
229
230
return
$this;
231
}
232
237
public
function
withVersion
(?
int
$version)
238
{
239
$this->version = $version;
240
241
return
$this;
242
}
243
248
public
function
withCreatedAt
(?DateTimeImmutable $createdAt)
249
{
250
$this->createdAt = $createdAt;
251
252
return
$this;
253
}
254
259
public
function
withLastModifiedAt
(?DateTimeImmutable $lastModifiedAt)
260
{
261
$this->lastModifiedAt = $lastModifiedAt;
262
263
return
$this;
264
}
265
270
public
function
withLastModifiedBy
(?
LastModifiedBy
$lastModifiedBy)
271
{
272
$this->lastModifiedBy = $lastModifiedBy;
273
274
return
$this;
275
}
276
281
public
function
withCreatedBy
(?
CreatedBy
$createdBy)
282
{
283
$this->createdBy = $createdBy;
284
285
return
$this;
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
withProductCount
(?
int
$productCount)
315
{
316
$this->productCount = $productCount;
317
318
return
$this;
319
}
320
325
public
function
withMode
(?
string
$mode)
326
{
327
$this->mode = $mode;
328
329
return
$this;
330
}
331
336
public
function
withCustom
(?
CustomFields
$custom)
337
{
338
$this->custom = $custom;
339
340
return
$this;
341
}
342
347
public
function
withLastModifiedByBuilder
(?
LastModifiedByBuilder
$lastModifiedBy)
348
{
349
$this->lastModifiedBy = $lastModifiedBy;
350
351
return
$this;
352
}
353
358
public
function
withCreatedByBuilder
(?
CreatedByBuilder
$createdBy)
359
{
360
$this->createdBy = $createdBy;
361
362
return
$this;
363
}
364
369
public
function
withNameBuilder
(?
LocalizedStringBuilder
$name)
370
{
371
$this->name = $name;
372
373
return
$this;
374
}
375
380
public
function
withCustomBuilder
(?
CustomFieldsBuilder
$custom)
381
{
382
$this->custom = $custom;
383
384
return
$this;
385
}
386
387
public
function
build
():
ProductSelection
388
{
389
return
new
ProductSelectionModel
(
390
$this->
id
,
391
$this->version,
392
$this->createdAt,
393
$this->lastModifiedAt,
394
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy,
395
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy,
396
$this->key,
397
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name,
398
$this->productCount,
399
$this->mode,
400
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom
401
);
402
}
403
404
public
static
function
of
():
ProductSelectionBuilder
405
{
406
return
new
self
();
407
}
408
}
Commercetools\Api\Models\Common\BaseResourceBuilder
Definition
BaseResourceBuilder.php:491
Commercetools\Api\Models\Common\CreatedByBuilder
Definition
CreatedByBuilder.php:24
Commercetools\Api\Models\Common\CreatedByBuilder\build
build()
Definition
CreatedByBuilder.php:226
Commercetools\Api\Models\Common\LastModifiedByBuilder
Definition
LastModifiedByBuilder.php:24
Commercetools\Api\Models\Common\LastModifiedByBuilder\build
build()
Definition
LastModifiedByBuilder.php:226
Commercetools\Api\Models\Common\LocalizedStringBuilder
Definition
LocalizedStringBuilder.php:20
Commercetools\Api\Models\Common\LocalizedStringBuilder\build
build()
Definition
LocalizedStringBuilder.php:42
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder
Definition
ProductSelectionBuilder.php:33
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getLastModifiedAt
getLastModifiedAt()
Definition
ProductSelectionBuilder.php:139
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getProductCount
getProductCount()
Definition
ProductSelectionBuilder.php:194
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withKey
withKey(?string $key)
Definition
ProductSelectionBuilder.php:292
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsBuilder $custom)
Definition
ProductSelectionBuilder.php:380
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withProductCount
withProductCount(?int $productCount)
Definition
ProductSelectionBuilder.php:314
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getName
getName()
Definition
ProductSelectionBuilder.php:183
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withCreatedByBuilder
withCreatedByBuilder(?CreatedByBuilder $createdBy)
Definition
ProductSelectionBuilder.php:358
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getLastModifiedBy
getLastModifiedBy()
Definition
ProductSelectionBuilder.php:150
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getCreatedAt
getCreatedAt()
Definition
ProductSelectionBuilder.php:128
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getCreatedBy
getCreatedBy()
Definition
ProductSelectionBuilder.php:161
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withMode
withMode(?string $mode)
Definition
ProductSelectionBuilder.php:325
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withLastModifiedByBuilder
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
Definition
ProductSelectionBuilder.php:347
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\build
build()
Definition
ProductSelectionBuilder.php:387
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getVersion
getVersion()
Definition
ProductSelectionBuilder.php:117
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withLastModifiedAt
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
Definition
ProductSelectionBuilder.php:259
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withCreatedAt
withCreatedAt(?DateTimeImmutable $createdAt)
Definition
ProductSelectionBuilder.php:248
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withCreatedBy
withCreatedBy(?CreatedBy $createdBy)
Definition
ProductSelectionBuilder.php:281
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getCustom
getCustom()
Definition
ProductSelectionBuilder.php:217
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withName
withName(?LocalizedString $name)
Definition
ProductSelectionBuilder.php:303
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getMode
getMode()
Definition
ProductSelectionBuilder.php:206
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withCustom
withCustom(?CustomFields $custom)
Definition
ProductSelectionBuilder.php:336
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withVersion
withVersion(?int $version)
Definition
ProductSelectionBuilder.php:237
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withId
withId(?string $id)
Definition
ProductSelectionBuilder.php:226
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\of
static of()
Definition
ProductSelectionBuilder.php:404
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withNameBuilder
withNameBuilder(?LocalizedStringBuilder $name)
Definition
ProductSelectionBuilder.php:369
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\withLastModifiedBy
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
Definition
ProductSelectionBuilder.php:270
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getId
getId()
Definition
ProductSelectionBuilder.php:106
Commercetools\Api\Models\ProductSelection\ProductSelectionBuilder\getKey
getKey()
Definition
ProductSelectionBuilder.php:172
Commercetools\Api\Models\ProductSelection\ProductSelectionModel
Definition
ProductSelectionModel.php:32
Commercetools\Api\Models\Type\CustomFieldsBuilder
Definition
CustomFieldsBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsBuilder\build
build()
Definition
CustomFieldsBuilder.php:101
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\BaseResource
Definition
BaseResource.php:250
Commercetools\Api\Models\Common\CreatedBy
Definition
CreatedBy.php:16
Commercetools\Api\Models\Common\LastModifiedBy
Definition
LastModifiedBy.php:16
Commercetools\Api\Models\Common\LocalizedString
Definition
LocalizedString.php:14
Commercetools\Api\Models\ProductSelection\ProductSelection
Definition
ProductSelection.php:21
Commercetools\Api\Models\Type\CustomFields
Definition
CustomFields.php:15
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\ProductSelection
Definition
AssignedProductReference.php:9
Generated by
1.9.8