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
AssociateRole
AssociateRoleDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\AssociateRole
;
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
AssociateRoleDraftModel
extends
JsonObjectModel
implements
AssociateRoleDraft
23
{
28
protected
$key
;
29
34
protected
$name
;
35
40
protected
$buyerAssignable
;
41
46
protected
$permissions
;
47
52
protected
$custom
;
53
54
58
public
function
__construct
(
59
?
string
$key
=
null
,
60
?
string
$name
=
null
,
61
?
bool
$buyerAssignable
=
null
,
62
?array
$permissions
=
null
,
63
?
CustomFieldsDraft
$custom
=
null
64
) {
65
$this->key =
$key
;
66
$this->name =
$name
;
67
$this->buyerAssignable =
$buyerAssignable
;
68
$this->permissions =
$permissions
;
69
$this->custom =
$custom
;
70
}
71
78
public
function
getKey
()
79
{
80
if
(is_null($this->key)) {
82
$data = $this->
raw
(self::FIELD_KEY);
83
if
(is_null($data)) {
84
return
null
;
85
}
86
$this->key = (string) $data;
87
}
88
89
return
$this->key
;
90
}
91
98
public
function
getName
()
99
{
100
if
(is_null($this->name)) {
102
$data = $this->
raw
(self::FIELD_NAME);
103
if
(is_null($data)) {
104
return
null
;
105
}
106
$this->name = (string) $data;
107
}
108
109
return
$this->name
;
110
}
111
118
public
function
getBuyerAssignable
()
119
{
120
if
(is_null($this->buyerAssignable)) {
122
$data = $this->
raw
(self::FIELD_BUYER_ASSIGNABLE);
123
if
(is_null($data)) {
124
return
null
;
125
}
126
$this->buyerAssignable = (bool) $data;
127
}
128
129
return
$this->buyerAssignable
;
130
}
131
138
public
function
getPermissions
()
139
{
140
if
(is_null($this->permissions)) {
142
$data = $this->
raw
(self::FIELD_PERMISSIONS);
143
if
(is_null($data)) {
144
return
null
;
145
}
146
$this->permissions = $data;
147
}
148
149
return
$this->permissions
;
150
}
151
158
public
function
getCustom
()
159
{
160
if
(is_null($this->custom)) {
162
$data = $this->
raw
(self::FIELD_CUSTOM);
163
if
(is_null($data)) {
164
return
null
;
165
}
166
167
$this->custom =
CustomFieldsDraftModel::of
($data);
168
}
169
170
return
$this->custom
;
171
}
172
173
177
public
function
setKey
(?
string
$key
): void
178
{
179
$this->key =
$key
;
180
}
181
185
public
function
setName
(?
string
$name
): void
186
{
187
$this->name =
$name
;
188
}
189
193
public
function
setBuyerAssignable
(?
bool
$buyerAssignable
): void
194
{
195
$this->buyerAssignable =
$buyerAssignable
;
196
}
197
201
public
function
setPermissions
(?array
$permissions
): void
202
{
203
$this->permissions =
$permissions
;
204
}
205
209
public
function
setCustom
(?
CustomFieldsDraft
$custom
): void
210
{
211
$this->custom =
$custom
;
212
}
213
}
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel
Definition
AssociateRoleDraftModel.php:23
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\$custom
$custom
Definition
AssociateRoleDraftModel.php:52
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\getPermissions
getPermissions()
Definition
AssociateRoleDraftModel.php:138
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\__construct
__construct(?string $key=null, ?string $name=null, ?bool $buyerAssignable=null, ?array $permissions=null, ?CustomFieldsDraft $custom=null)
Definition
AssociateRoleDraftModel.php:58
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\$key
$key
Definition
AssociateRoleDraftModel.php:28
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\getName
getName()
Definition
AssociateRoleDraftModel.php:98
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\$name
$name
Definition
AssociateRoleDraftModel.php:34
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\setName
setName(?string $name)
Definition
AssociateRoleDraftModel.php:185
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\setKey
setKey(?string $key)
Definition
AssociateRoleDraftModel.php:177
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\setBuyerAssignable
setBuyerAssignable(?bool $buyerAssignable)
Definition
AssociateRoleDraftModel.php:193
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\setPermissions
setPermissions(?array $permissions)
Definition
AssociateRoleDraftModel.php:201
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\getBuyerAssignable
getBuyerAssignable()
Definition
AssociateRoleDraftModel.php:118
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\setCustom
setCustom(?CustomFieldsDraft $custom)
Definition
AssociateRoleDraftModel.php:209
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\$permissions
$permissions
Definition
AssociateRoleDraftModel.php:46
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\$buyerAssignable
$buyerAssignable
Definition
AssociateRoleDraftModel.php:40
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\getCustom
getCustom()
Definition
AssociateRoleDraftModel.php:158
Commercetools\Api\Models\AssociateRole\AssociateRoleDraftModel\getKey
getKey()
Definition
AssociateRoleDraftModel.php:78
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\AssociateRole\AssociateRoleDraft
Definition
AssociateRoleDraft.php:16
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\AssociateRole
Definition
AssociateRole.php:9
Generated by
1.9.8