commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
AttributeGroup
AttributeGroupDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\AttributeGroup
;
10
11
use
Commercetools\Api\Models\Common\LocalizedString
;
12
use
Commercetools\Api\Models\Common\LocalizedStringBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
AttributeGroupDraftBuilder
implements
Builder
24
{
29
private
$name;
30
35
private
$description;
36
41
private
$attributes;
42
47
private
$key;
48
55
public
function
getName
()
56
{
57
return
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name;
58
}
59
66
public
function
getDescription
()
67
{
68
return
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description;
69
}
70
77
public
function
getAttributes
()
78
{
79
return
$this->attributes;
80
}
81
88
public
function
getKey
()
89
{
90
return
$this->key;
91
}
92
97
public
function
withName
(?
LocalizedString
$name)
98
{
99
$this->name = $name;
100
101
return
$this;
102
}
103
108
public
function
withDescription
(?
LocalizedString
$description)
109
{
110
$this->description = $description;
111
112
return
$this;
113
}
114
119
public
function
withAttributes
(?
AttributeReferenceCollection
$attributes)
120
{
121
$this->attributes = $attributes;
122
123
return
$this;
124
}
125
130
public
function
withKey
(?
string
$key)
131
{
132
$this->key = $key;
133
134
return
$this;
135
}
136
141
public
function
withNameBuilder
(?
LocalizedStringBuilder
$name)
142
{
143
$this->name = $name;
144
145
return
$this;
146
}
147
152
public
function
withDescriptionBuilder
(?
LocalizedStringBuilder
$description)
153
{
154
$this->description = $description;
155
156
return
$this;
157
}
158
159
public
function
build
():
AttributeGroupDraft
160
{
161
return
new
AttributeGroupDraftModel
(
162
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name,
163
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description,
164
$this->attributes,
165
$this->key
166
);
167
}
168
169
public
static
function
of
():
AttributeGroupDraftBuilder
170
{
171
return
new
self
();
172
}
173
}
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder
Definition:
AttributeGroupDraftBuilder.php:24
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\withDescriptionBuilder
withDescriptionBuilder(?LocalizedStringBuilder $description)
Definition:
AttributeGroupDraftBuilder.php:152
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\build
build()
Definition:
AttributeGroupDraftBuilder.php:159
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\getAttributes
getAttributes()
Definition:
AttributeGroupDraftBuilder.php:77
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\of
static of()
Definition:
AttributeGroupDraftBuilder.php:169
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\getName
getName()
Definition:
AttributeGroupDraftBuilder.php:55
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\getKey
getKey()
Definition:
AttributeGroupDraftBuilder.php:88
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\withNameBuilder
withNameBuilder(?LocalizedStringBuilder $name)
Definition:
AttributeGroupDraftBuilder.php:141
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\withName
withName(?LocalizedString $name)
Definition:
AttributeGroupDraftBuilder.php:97
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\withDescription
withDescription(?LocalizedString $description)
Definition:
AttributeGroupDraftBuilder.php:108
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\getDescription
getDescription()
Definition:
AttributeGroupDraftBuilder.php:66
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\withAttributes
withAttributes(?AttributeReferenceCollection $attributes)
Definition:
AttributeGroupDraftBuilder.php:119
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftBuilder\withKey
withKey(?string $key)
Definition:
AttributeGroupDraftBuilder.php:130
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel
Definition:
AttributeGroupDraftModel.php:23
Commercetools\Api\Models\AttributeGroup\AttributeReferenceCollection
Definition:
AttributeReferenceCollection.php:22
Commercetools\Api\Models\Common\LocalizedStringBuilder
Definition:
LocalizedStringBuilder.php:20
Commercetools\Api\Models\Common\LocalizedStringBuilder\build
build()
Definition:
LocalizedStringBuilder.php:42
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraft
Definition:
AttributeGroupDraft.php:16
Commercetools\Api\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\AttributeGroup
Definition:
AttributeGroup.php:9
Generated by
1.9.1