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
CustomObject
CustomObjectBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CustomObject
;
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\Base\Builder
;
18
use
Commercetools\Base\DateTimeImmutableCollection
;
19
use
Commercetools\Base\JsonObject
;
20
use
Commercetools\Base\JsonObjectModel
;
21
use
Commercetools\Base\MapperFactory
;
22
use DateTimeImmutable;
23
use stdClass;
24
28
final
class
CustomObjectBuilder
implements
Builder
29
{
34
private
$id;
35
40
private
$version;
41
46
private
$createdAt;
47
52
private
$lastModifiedAt;
53
58
private
$lastModifiedBy;
59
64
private
$createdBy;
65
70
private
$container;
71
76
private
$key;
77
82
private
$value;
83
90
public
function
getId
()
91
{
92
return
$this->id;
93
}
94
101
public
function
getVersion
()
102
{
103
return
$this->version;
104
}
105
112
public
function
getCreatedAt
()
113
{
114
return
$this->createdAt;
115
}
116
123
public
function
getLastModifiedAt
()
124
{
125
return
$this->lastModifiedAt;
126
}
127
134
public
function
getLastModifiedBy
()
135
{
136
return
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy;
137
}
138
145
public
function
getCreatedBy
()
146
{
147
return
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy;
148
}
149
156
public
function
getContainer
()
157
{
158
return
$this->container;
159
}
160
167
public
function
getKey
()
168
{
169
return
$this->key;
170
}
171
181
public
function
getValue
()
182
{
183
return
$this->value;
184
}
185
190
public
function
withId
(?
string
$id)
191
{
192
$this->
id
= $id;
193
194
return
$this;
195
}
196
201
public
function
withVersion
(?
int
$version)
202
{
203
$this->version = $version;
204
205
return
$this;
206
}
207
212
public
function
withCreatedAt
(?DateTimeImmutable $createdAt)
213
{
214
$this->createdAt = $createdAt;
215
216
return
$this;
217
}
218
223
public
function
withLastModifiedAt
(?DateTimeImmutable $lastModifiedAt)
224
{
225
$this->lastModifiedAt = $lastModifiedAt;
226
227
return
$this;
228
}
229
234
public
function
withLastModifiedBy
(?
LastModifiedBy
$lastModifiedBy)
235
{
236
$this->lastModifiedBy = $lastModifiedBy;
237
238
return
$this;
239
}
240
245
public
function
withCreatedBy
(?
CreatedBy
$createdBy)
246
{
247
$this->createdBy = $createdBy;
248
249
return
$this;
250
}
251
256
public
function
withContainer
(?
string
$container)
257
{
258
$this->container = $container;
259
260
return
$this;
261
}
262
267
public
function
withKey
(?
string
$key)
268
{
269
$this->key = $key;
270
271
return
$this;
272
}
273
278
public
function
withValue
($value)
279
{
280
$this->value = $value;
281
282
return
$this;
283
}
284
289
public
function
withLastModifiedByBuilder
(?
LastModifiedByBuilder
$lastModifiedBy)
290
{
291
$this->lastModifiedBy = $lastModifiedBy;
292
293
return
$this;
294
}
295
300
public
function
withCreatedByBuilder
(?
CreatedByBuilder
$createdBy)
301
{
302
$this->createdBy = $createdBy;
303
304
return
$this;
305
}
306
307
public
function
build
():
CustomObject
308
{
309
return
new
CustomObjectModel
(
310
$this->
id
,
311
$this->version,
312
$this->createdAt,
313
$this->lastModifiedAt,
314
$this->lastModifiedBy instanceof
LastModifiedByBuilder
? $this->lastModifiedBy->
build
() : $this->lastModifiedBy,
315
$this->createdBy instanceof
CreatedByBuilder
? $this->createdBy->
build
() : $this->createdBy,
316
$this->container,
317
$this->key,
318
$this->value
319
);
320
}
321
322
public
static
function
of
():
CustomObjectBuilder
323
{
324
return
new
self
();
325
}
326
}
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\CustomObject\CustomObjectBuilder
Definition
CustomObjectBuilder.php:29
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withCreatedBy
withCreatedBy(?CreatedBy $createdBy)
Definition
CustomObjectBuilder.php:245
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getVersion
getVersion()
Definition
CustomObjectBuilder.php:101
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\build
build()
Definition
CustomObjectBuilder.php:307
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getCreatedAt
getCreatedAt()
Definition
CustomObjectBuilder.php:112
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withValue
withValue($value)
Definition
CustomObjectBuilder.php:278
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withVersion
withVersion(?int $version)
Definition
CustomObjectBuilder.php:201
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getValue
getValue()
Definition
CustomObjectBuilder.php:181
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withId
withId(?string $id)
Definition
CustomObjectBuilder.php:190
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withLastModifiedBy
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
Definition
CustomObjectBuilder.php:234
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getKey
getKey()
Definition
CustomObjectBuilder.php:167
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getCreatedBy
getCreatedBy()
Definition
CustomObjectBuilder.php:145
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withLastModifiedByBuilder
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
Definition
CustomObjectBuilder.php:289
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withKey
withKey(?string $key)
Definition
CustomObjectBuilder.php:267
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\of
static of()
Definition
CustomObjectBuilder.php:322
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getId
getId()
Definition
CustomObjectBuilder.php:90
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withCreatedByBuilder
withCreatedByBuilder(?CreatedByBuilder $createdBy)
Definition
CustomObjectBuilder.php:300
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withLastModifiedAt
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
Definition
CustomObjectBuilder.php:223
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withCreatedAt
withCreatedAt(?DateTimeImmutable $createdAt)
Definition
CustomObjectBuilder.php:212
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getContainer
getContainer()
Definition
CustomObjectBuilder.php:156
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getLastModifiedAt
getLastModifiedAt()
Definition
CustomObjectBuilder.php:123
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\getLastModifiedBy
getLastModifiedBy()
Definition
CustomObjectBuilder.php:134
Commercetools\Api\Models\CustomObject\CustomObjectBuilder\withContainer
withContainer(?string $container)
Definition
CustomObjectBuilder.php:256
Commercetools\Api\Models\CustomObject\CustomObjectModel
Definition
CustomObjectModel.php:28
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\CustomObject\CustomObject
Definition
CustomObject.php:19
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\CustomObject
Definition
CustomObject.php:9
Generated by
1.9.8