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
AttributeGroup
AttributeGroupDraftModel.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\LocalizedStringModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
AttributeGroupDraftModel
extends
JsonObjectModel
implements
AttributeGroupDraft
23
{
28
protected
$name
;
29
34
protected
$description
;
35
40
protected
$attributes
;
41
46
protected
$key
;
47
48
52
public
function
__construct
(
53
?
LocalizedString
$name
=
null
,
54
?
LocalizedString
$description
=
null
,
55
?
AttributeReferenceCollection
$attributes
=
null
,
56
?
string
$key
=
null
57
) {
58
$this->name =
$name
;
59
$this->description =
$description
;
60
$this->attributes =
$attributes
;
61
$this->key =
$key
;
62
}
63
70
public
function
getName
()
71
{
72
if
(is_null($this->name)) {
74
$data = $this->
raw
(self::FIELD_NAME);
75
if
(is_null($data)) {
76
return
null
;
77
}
78
79
$this->name = LocalizedStringModel::of($data);
80
}
81
82
return
$this->name
;
83
}
84
91
public
function
getDescription
()
92
{
93
if
(is_null($this->description)) {
95
$data = $this->
raw
(self::FIELD_DESCRIPTION);
96
if
(is_null($data)) {
97
return
null
;
98
}
99
100
$this->description = LocalizedStringModel::of($data);
101
}
102
103
return
$this->description
;
104
}
105
112
public
function
getAttributes
()
113
{
114
if
(is_null($this->attributes)) {
116
$data = $this->
raw
(self::FIELD_ATTRIBUTES);
117
if
(is_null($data)) {
118
return
null
;
119
}
120
$this->attributes =
AttributeReferenceCollection::fromArray
($data);
121
}
122
123
return
$this->attributes
;
124
}
125
132
public
function
getKey
()
133
{
134
if
(is_null($this->key)) {
136
$data = $this->
raw
(self::FIELD_KEY);
137
if
(is_null($data)) {
138
return
null
;
139
}
140
$this->key = (string) $data;
141
}
142
143
return
$this->key
;
144
}
145
146
150
public
function
setName
(?
LocalizedString
$name
): void
151
{
152
$this->name =
$name
;
153
}
154
158
public
function
setDescription
(?
LocalizedString
$description
): void
159
{
160
$this->description =
$description
;
161
}
162
166
public
function
setAttributes
(?
AttributeReferenceCollection
$attributes
): void
167
{
168
$this->attributes =
$attributes
;
169
}
170
174
public
function
setKey
(?
string
$key
): void
175
{
176
$this->key =
$key
;
177
}
178
}
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel
Definition
AttributeGroupDraftModel.php:23
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\getKey
getKey()
Definition
AttributeGroupDraftModel.php:132
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\$attributes
$attributes
Definition
AttributeGroupDraftModel.php:40
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\setAttributes
setAttributes(?AttributeReferenceCollection $attributes)
Definition
AttributeGroupDraftModel.php:166
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\setDescription
setDescription(?LocalizedString $description)
Definition
AttributeGroupDraftModel.php:158
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\getName
getName()
Definition
AttributeGroupDraftModel.php:70
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\$key
$key
Definition
AttributeGroupDraftModel.php:46
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\$name
$name
Definition
AttributeGroupDraftModel.php:28
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\setName
setName(?LocalizedString $name)
Definition
AttributeGroupDraftModel.php:150
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\setKey
setKey(?string $key)
Definition
AttributeGroupDraftModel.php:174
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\__construct
__construct(?LocalizedString $name=null, ?LocalizedString $description=null, ?AttributeReferenceCollection $attributes=null, ?string $key=null)
Definition
AttributeGroupDraftModel.php:52
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\getAttributes
getAttributes()
Definition
AttributeGroupDraftModel.php:112
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\$description
$description
Definition
AttributeGroupDraftModel.php:34
Commercetools\Api\Models\AttributeGroup\AttributeGroupDraftModel\getDescription
getDescription()
Definition
AttributeGroupDraftModel.php:91
Commercetools\Api\Models\AttributeGroup\AttributeReferenceCollection
Definition
AttributeReferenceCollection.php:22
Commercetools\Api\Models\Common\LocalizedStringModel
Definition
LocalizedStringModel.php:17
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
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\CSequence\fromArray
static fromArray(array $data)
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\AttributeGroup
Definition
AttributeGroup.php:9
Generated by
1.9.8