commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
CustomerGroup
CustomerGroupDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CustomerGroup
;
10
11
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
12
use
Commercetools\Api\Models\Type\CustomFieldsDraftModel
;
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
CustomerGroupDraftModel
extends
JsonObjectModel
implements
CustomerGroupDraft
23
{
28
protected
$key
;
29
34
protected
$groupName
;
35
40
protected
$custom
;
41
42
46
public
function
__construct
(
47
?
string
$key
=
null
,
48
?
string
$groupName
=
null
,
49
?
CustomFieldsDraft
$custom
=
null
50
) {
51
$this->key =
$key
;
52
$this->groupName =
$groupName
;
53
$this->custom =
$custom
;
54
}
55
62
public
function
getKey
()
63
{
64
if
(is_null($this->key)) {
66
$data = $this->
raw
(self::FIELD_KEY);
67
if
(is_null($data)) {
68
return
null
;
69
}
70
$this->key = (string) $data;
71
}
72
73
return
$this->key
;
74
}
75
83
public
function
getGroupName
()
84
{
85
if
(is_null($this->groupName)) {
87
$data = $this->
raw
(self::FIELD_GROUP_NAME);
88
if
(is_null($data)) {
89
return
null
;
90
}
91
$this->groupName = (string) $data;
92
}
93
94
return
$this->groupName
;
95
}
96
103
public
function
getCustom
()
104
{
105
if
(is_null($this->custom)) {
107
$data = $this->
raw
(self::FIELD_CUSTOM);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
112
$this->custom =
CustomFieldsDraftModel::of
($data);
113
}
114
115
return
$this->custom
;
116
}
117
118
122
public
function
setKey
(?
string
$key
): void
123
{
124
$this->key =
$key
;
125
}
126
130
public
function
setGroupName
(?
string
$groupName
): void
131
{
132
$this->groupName =
$groupName
;
133
}
134
138
public
function
setCustom
(?
CustomFieldsDraft
$custom
): void
139
{
140
$this->custom =
$custom
;
141
}
142
}
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel
Definition:
CustomerGroupDraftModel.php:23
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\getKey
getKey()
Definition:
CustomerGroupDraftModel.php:62
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\$key
$key
Definition:
CustomerGroupDraftModel.php:28
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\getGroupName
getGroupName()
Definition:
CustomerGroupDraftModel.php:83
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\getCustom
getCustom()
Definition:
CustomerGroupDraftModel.php:103
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\setKey
setKey(?string $key)
Definition:
CustomerGroupDraftModel.php:122
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\$custom
$custom
Definition:
CustomerGroupDraftModel.php:40
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\__construct
__construct(?string $key=null, ?string $groupName=null, ?CustomFieldsDraft $custom=null)
Definition:
CustomerGroupDraftModel.php:46
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\setGroupName
setGroupName(?string $groupName)
Definition:
CustomerGroupDraftModel.php:130
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\$groupName
$groupName
Definition:
CustomerGroupDraftModel.php:34
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraftModel\setCustom
setCustom(?CustomFieldsDraft $custom)
Definition:
CustomerGroupDraftModel.php:138
Commercetools\Api\Models\Type\CustomFieldsDraftModel
Definition:
CustomFieldsDraftModel.php:21
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\CustomerGroup\CustomerGroupDraft
Definition:
CustomerGroupDraft.php:16
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition:
CustomFieldsDraft.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\CustomerGroup
Definition:
CustomerGroup.php:9
Generated by
1.9.1