commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-import
src
Models
Customfields
CustomBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Import\Models\Customfields
;
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
Commercetools\Import\Models\Common\TypeKeyReference
;
17
use
Commercetools\Import\Models\Common\TypeKeyReferenceBuilder
;
18
use stdClass;
19
23
final
class
CustomBuilder
implements
Builder
24
{
29
private
$type;
30
35
private
$fields;
36
43
public
function
getType
()
44
{
45
return
$this->type instanceof
TypeKeyReferenceBuilder
? $this->type->
build
() : $this->type;
46
}
47
54
public
function
getFields
()
55
{
56
return
$this->fields instanceof
FieldContainerBuilder
? $this->fields->
build
() : $this->fields;
57
}
58
63
public
function
withType
(?
TypeKeyReference
$type)
64
{
65
$this->type = $type;
66
67
return
$this;
68
}
69
74
public
function
withFields
(?
FieldContainer
$fields)
75
{
76
$this->fields = $fields;
77
78
return
$this;
79
}
80
85
public
function
withTypeBuilder
(?
TypeKeyReferenceBuilder
$type)
86
{
87
$this->type = $type;
88
89
return
$this;
90
}
91
96
public
function
withFieldsBuilder
(?
FieldContainerBuilder
$fields)
97
{
98
$this->fields = $fields;
99
100
return
$this;
101
}
102
103
public
function
build
():
Custom
104
{
105
return
new
CustomModel
(
106
$this->type instanceof
TypeKeyReferenceBuilder
? $this->type->
build
() : $this->type,
107
$this->fields instanceof
FieldContainerBuilder
? $this->fields->
build
() : $this->fields
108
);
109
}
110
111
public
static
function
of
():
CustomBuilder
112
{
113
return
new
self
();
114
}
115
}
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Import\Models\Common\TypeKeyReferenceBuilder
Definition:
TypeKeyReferenceBuilder.php:22
Commercetools\Import\Models\Common\TypeKeyReferenceBuilder\build
build()
Definition:
TypeKeyReferenceBuilder.php:50
Commercetools\Import\Models\Customfields\CustomBuilder
Definition:
CustomBuilder.php:24
Commercetools\Import\Models\Customfields\CustomBuilder\getFields
getFields()
Definition:
CustomBuilder.php:54
Commercetools\Import\Models\Customfields\CustomBuilder\getType
getType()
Definition:
CustomBuilder.php:43
Commercetools\Import\Models\Customfields\CustomBuilder\withFields
withFields(?FieldContainer $fields)
Definition:
CustomBuilder.php:74
Commercetools\Import\Models\Customfields\CustomBuilder\withFieldsBuilder
withFieldsBuilder(?FieldContainerBuilder $fields)
Definition:
CustomBuilder.php:96
Commercetools\Import\Models\Customfields\CustomBuilder\of
static of()
Definition:
CustomBuilder.php:111
Commercetools\Import\Models\Customfields\CustomBuilder\withType
withType(?TypeKeyReference $type)
Definition:
CustomBuilder.php:63
Commercetools\Import\Models\Customfields\CustomBuilder\withTypeBuilder
withTypeBuilder(?TypeKeyReferenceBuilder $type)
Definition:
CustomBuilder.php:85
Commercetools\Import\Models\Customfields\CustomBuilder\build
build()
Definition:
CustomBuilder.php:103
Commercetools\Import\Models\Customfields\CustomModel
Definition:
CustomModel.php:23
Commercetools\Import\Models\Customfields\FieldContainerBuilder
Definition:
FieldContainerBuilder.php:20
Commercetools\Import\Models\Customfields\FieldContainerBuilder\build
build()
Definition:
FieldContainerBuilder.php:42
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Import\Models\Common\TypeKeyReference
Definition:
TypeKeyReference.php:15
Commercetools\Import\Models\Customfields\Custom
Definition:
Custom.php:16
Commercetools\Import\Models\Customfields\FieldContainer
Definition:
FieldContainer.php:14
Commercetools\Import\Models\Customfields
Definition:
BooleanField.php:9
Generated by
1.9.1