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
CustomerGroup
CustomerGroupBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CustomerGroup
;
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\Type\CustomFields
;
18
use
Commercetools\Api\Models\Type\CustomFieldsBuilder
;
19
use
Commercetools\Base\Builder
;
20
use
Commercetools\Base\DateTimeImmutableCollection
;
21
use
Commercetools\Base\JsonObject
;
22
use
Commercetools\Base\JsonObjectModel
;
23
use
Commercetools\Base\MapperFactory
;
24
use DateTimeImmutable;
25
use stdClass;
26
30
final
class
CustomerGroupBuilder
implements
Builder
31
{
36
private
$id;
37
42
private
$version;
43
48
private
$createdAt;
49
54
private
$lastModifiedAt;
55
60
private
$lastModifiedBy;
61
66
private
$createdBy;
67
72
private
$key;
73
78
private
$name;
79
84
private
$custom;
85
92
public
function
getId
()
93
{
94
return
$this->id;
95
}
96
103
public
function
getVersion
()
104
{
105
return
$this->version;
106
}
107
114
public
function
getCreatedAt
()
115
{
116
return
$this->createdAt;
117
}
118
125
public
function
getLastModifiedAt
()
126
{
127
return
$this->lastModifiedAt;
128
}
129
136
public
function
getLastModifiedBy
()
137
{
138
return
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy;
139
}
140
147
public
function
getCreatedBy
()
148
{
149
return
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy;
150
}
151
158
public
function
getKey
()
159
{
160
return
$this->key;
161
}
162
169
public
function
getName
()
170
{
171
return
$this->name;
172
}
173
180
public
function
getCustom
()
181
{
182
return
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom;
183
}
184
189
public
function
withId
(?
string
$id)
190
{
191
$this->
id
= $id;
192
193
return
$this;
194
}
195
200
public
function
withVersion
(?
int
$version)
201
{
202
$this->version = $version;
203
204
return
$this;
205
}
206
211
public
function
withCreatedAt
(?DateTimeImmutable $createdAt)
212
{
213
$this->createdAt = $createdAt;
214
215
return
$this;
216
}
217
222
public
function
withLastModifiedAt
(?DateTimeImmutable $lastModifiedAt)
223
{
224
$this->lastModifiedAt = $lastModifiedAt;
225
226
return
$this;
227
}
228
233
public
function
withLastModifiedBy
(?
LastModifiedBy
$lastModifiedBy)
234
{
235
$this->lastModifiedBy = $lastModifiedBy;
236
237
return
$this;
238
}
239
244
public
function
withCreatedBy
(?
CreatedBy
$createdBy)
245
{
246
$this->createdBy = $createdBy;
247
248
return
$this;
249
}
250
255
public
function
withKey
(?
string
$key)
256
{
257
$this->key = $key;
258
259
return
$this;
260
}
261
266
public
function
withName
(?
string
$name)
267
{
268
$this->name = $name;
269
270
return
$this;
271
}
272
277
public
function
withCustom
(?
CustomFields
$custom)
278
{
279
$this->custom = $custom;
280
281
return
$this;
282
}
283
288
public
function
withLastModifiedByBuilder
(?
LastModifiedByBuilder
$lastModifiedBy)
289
{
290
$this->lastModifiedBy = $lastModifiedBy;
291
292
return
$this;
293
}
294
299
public
function
withCreatedByBuilder
(?
CreatedByBuilder
$createdBy)
300
{
301
$this->createdBy = $createdBy;
302
303
return
$this;
304
}
305
310
public
function
withCustomBuilder
(?
CustomFieldsBuilder
$custom)
311
{
312
$this->custom = $custom;
313
314
return
$this;
315
}
316
317
public
function
build
():
CustomerGroup
318
{
319
return
new
CustomerGroupModel
(
320
$this->
id
,
321
$this->version,
322
$this->createdAt,
323
$this->lastModifiedAt,
324
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy,
325
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy,
326
$this->key,
327
$this->name,
328
$this->custom instanceof
CustomFieldsBuilder
? $this->custom->
build
() : $this->custom
329
);
330
}
331
332
public
static
function
of
():
CustomerGroupBuilder
333
{
334
return
new
self
();
335
}
336
}
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\CustomerGroup\CustomerGroupBuilder
Definition
CustomerGroupBuilder.php:31
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withId
withId(?string $id)
Definition
CustomerGroupBuilder.php:189
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withName
withName(?string $name)
Definition
CustomerGroupBuilder.php:266
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withCustom
withCustom(?CustomFields $custom)
Definition
CustomerGroupBuilder.php:277
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getCreatedBy
getCreatedBy()
Definition
CustomerGroupBuilder.php:147
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsBuilder $custom)
Definition
CustomerGroupBuilder.php:310
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withLastModifiedByBuilder
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
Definition
CustomerGroupBuilder.php:288
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withVersion
withVersion(?int $version)
Definition
CustomerGroupBuilder.php:200
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withLastModifiedAt
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
Definition
CustomerGroupBuilder.php:222
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withKey
withKey(?string $key)
Definition
CustomerGroupBuilder.php:255
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getId
getId()
Definition
CustomerGroupBuilder.php:92
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getName
getName()
Definition
CustomerGroupBuilder.php:169
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withCreatedBy
withCreatedBy(?CreatedBy $createdBy)
Definition
CustomerGroupBuilder.php:244
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getCustom
getCustom()
Definition
CustomerGroupBuilder.php:180
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withLastModifiedBy
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
Definition
CustomerGroupBuilder.php:233
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withCreatedByBuilder
withCreatedByBuilder(?CreatedByBuilder $createdBy)
Definition
CustomerGroupBuilder.php:299
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getVersion
getVersion()
Definition
CustomerGroupBuilder.php:103
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getLastModifiedBy
getLastModifiedBy()
Definition
CustomerGroupBuilder.php:136
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\withCreatedAt
withCreatedAt(?DateTimeImmutable $createdAt)
Definition
CustomerGroupBuilder.php:211
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getCreatedAt
getCreatedAt()
Definition
CustomerGroupBuilder.php:114
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getKey
getKey()
Definition
CustomerGroupBuilder.php:158
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\getLastModifiedAt
getLastModifiedAt()
Definition
CustomerGroupBuilder.php:125
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\of
static of()
Definition
CustomerGroupBuilder.php:332
Commercetools\Api\Models\CustomerGroup\CustomerGroupBuilder\build
build()
Definition
CustomerGroupBuilder.php:317
Commercetools\Api\Models\CustomerGroup\CustomerGroupModel
Definition
CustomerGroupModel.php:30
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\CustomerGroup\CustomerGroup
Definition
CustomerGroup.php:20
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\CustomerGroup
Definition
CustomerGroup.php:9
Generated by
1.9.8