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
Type
CustomFieldsDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Type
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
21
final
class
CustomFieldsDraftBuilder
implements
Builder
22
{
27
private
$type;
28
33
private
$fields;
34
41
public
function
getType
()
42
{
43
return
$this->type instanceof
TypeResourceIdentifierBuilder
? $this->type->
build
() : $this->type;
44
}
45
52
public
function
getFields
()
53
{
54
return
$this->fields instanceof
FieldContainerBuilder
? $this->fields->
build
() : $this->fields;
55
}
56
61
public
function
withType
(?
TypeResourceIdentifier
$type)
62
{
63
$this->type = $type;
64
65
return
$this;
66
}
67
72
public
function
withFields
(?
FieldContainer
$fields)
73
{
74
$this->fields = $fields;
75
76
return
$this;
77
}
78
83
public
function
withTypeBuilder
(?
TypeResourceIdentifierBuilder
$type)
84
{
85
$this->type = $type;
86
87
return
$this;
88
}
89
94
public
function
withFieldsBuilder
(?
FieldContainerBuilder
$fields)
95
{
96
$this->fields = $fields;
97
98
return
$this;
99
}
100
101
public
function
build
():
CustomFieldsDraft
102
{
103
return
new
CustomFieldsDraftModel
(
104
$this->type instanceof
TypeResourceIdentifierBuilder
? $this->type->
build
() : $this->type,
105
$this->fields instanceof
FieldContainerBuilder
? $this->fields->
build
() : $this->fields
106
);
107
}
108
109
public
static
function
of
():
CustomFieldsDraftBuilder
110
{
111
return
new
self
();
112
}
113
}
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\of
static of()
Definition
CustomFieldsDraftBuilder.php:109
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\withFields
withFields(?FieldContainer $fields)
Definition
CustomFieldsDraftBuilder.php:72
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\withType
withType(?TypeResourceIdentifier $type)
Definition
CustomFieldsDraftBuilder.php:61
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\getType
getType()
Definition
CustomFieldsDraftBuilder.php:41
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\getFields
getFields()
Definition
CustomFieldsDraftBuilder.php:52
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\withTypeBuilder
withTypeBuilder(?TypeResourceIdentifierBuilder $type)
Definition
CustomFieldsDraftBuilder.php:83
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\withFieldsBuilder
withFieldsBuilder(?FieldContainerBuilder $fields)
Definition
CustomFieldsDraftBuilder.php:94
Commercetools\Api\Models\Type\CustomFieldsDraftModel
Definition
CustomFieldsDraftModel.php:21
Commercetools\Api\Models\Type\FieldContainerBuilder
Definition
FieldContainerBuilder.php:20
Commercetools\Api\Models\Type\FieldContainerBuilder\build
build()
Definition
FieldContainerBuilder.php:42
Commercetools\Api\Models\Type\TypeResourceIdentifierBuilder
Definition
TypeResourceIdentifierBuilder.php:24
Commercetools\Api\Models\Type\TypeResourceIdentifierBuilder\build
build()
Definition
TypeResourceIdentifierBuilder.php:82
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Api\Models\Type\FieldContainer
Definition
FieldContainer.php:14
Commercetools\Api\Models\Type\TypeResourceIdentifier
Definition
TypeResourceIdentifier.php:16
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Type
Definition
CustomFieldBooleanType.php:9
Generated by
1.9.8