commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
ProductSelection
ProductSelectionDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ProductSelection
;
10
11
use
Commercetools\Api\Models\Common\LocalizedString
;
12
use
Commercetools\Api\Models\Common\LocalizedStringModel
;
13
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
14
use
Commercetools\Api\Models\Type\CustomFieldsDraftModel
;
15
use
Commercetools\Base\DateTimeImmutableCollection
;
16
use
Commercetools\Base\JsonObject
;
17
use
Commercetools\Base\JsonObjectModel
;
18
use
Commercetools\Base\MapperFactory
;
19
use stdClass;
20
24
final
class
ProductSelectionDraftModel
extends
JsonObjectModel
implements
ProductSelectionDraft
25
{
30
protected
$key
;
31
36
protected
$name
;
37
42
protected
$custom
;
43
48
protected
$mode
;
49
50
54
public
function
__construct
(
55
?
string
$key
=
null
,
56
?
LocalizedString
$name
=
null
,
57
?
CustomFieldsDraft
$custom
=
null
,
58
?
string
$mode
=
null
59
) {
60
$this->key =
$key
;
61
$this->name =
$name
;
62
$this->custom =
$custom
;
63
$this->mode =
$mode
;
64
}
65
72
public
function
getKey
()
73
{
74
if
(is_null($this->key)) {
76
$data = $this->
raw
(self::FIELD_KEY);
77
if
(is_null($data)) {
78
return
null
;
79
}
80
$this->key = (string) $data;
81
}
82
83
return
$this->key
;
84
}
85
92
public
function
getName
()
93
{
94
if
(is_null($this->name)) {
96
$data = $this->
raw
(self::FIELD_NAME);
97
if
(is_null($data)) {
98
return
null
;
99
}
100
101
$this->name =
LocalizedStringModel::of
($data);
102
}
103
104
return
$this->name
;
105
}
106
113
public
function
getCustom
()
114
{
115
if
(is_null($this->custom)) {
117
$data = $this->
raw
(self::FIELD_CUSTOM);
118
if
(is_null($data)) {
119
return
null
;
120
}
121
122
$this->custom =
CustomFieldsDraftModel::of
($data);
123
}
124
125
return
$this->custom
;
126
}
127
134
public
function
getMode
()
135
{
136
if
(is_null($this->mode)) {
138
$data = $this->
raw
(self::FIELD_MODE);
139
if
(is_null($data)) {
140
return
null
;
141
}
142
$this->mode = (string) $data;
143
}
144
145
return
$this->mode
;
146
}
147
148
152
public
function
setKey
(?
string
$key
): void
153
{
154
$this->key =
$key
;
155
}
156
160
public
function
setName
(?
LocalizedString
$name
): void
161
{
162
$this->name =
$name
;
163
}
164
168
public
function
setCustom
(?
CustomFieldsDraft
$custom
): void
169
{
170
$this->custom =
$custom
;
171
}
172
176
public
function
setMode
(?
string
$mode
): void
177
{
178
$this->mode =
$mode
;
179
}
180
}
Commercetools\Api\Models\Common\LocalizedStringModel
Definition:
LocalizedStringModel.php:17
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel
Definition:
ProductSelectionDraftModel.php:25
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\$custom
$custom
Definition:
ProductSelectionDraftModel.php:42
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\setName
setName(?LocalizedString $name)
Definition:
ProductSelectionDraftModel.php:160
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\$mode
$mode
Definition:
ProductSelectionDraftModel.php:48
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\setCustom
setCustom(?CustomFieldsDraft $custom)
Definition:
ProductSelectionDraftModel.php:168
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\__construct
__construct(?string $key=null, ?LocalizedString $name=null, ?CustomFieldsDraft $custom=null, ?string $mode=null)
Definition:
ProductSelectionDraftModel.php:54
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\getName
getName()
Definition:
ProductSelectionDraftModel.php:92
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\getMode
getMode()
Definition:
ProductSelectionDraftModel.php:134
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\setMode
setMode(?string $mode)
Definition:
ProductSelectionDraftModel.php:176
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\$key
$key
Definition:
ProductSelectionDraftModel.php:30
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\setKey
setKey(?string $key)
Definition:
ProductSelectionDraftModel.php:152
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\$name
$name
Definition:
ProductSelectionDraftModel.php:36
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\getKey
getKey()
Definition:
ProductSelectionDraftModel.php:72
Commercetools\Api\Models\ProductSelection\ProductSelectionDraftModel\getCustom
getCustom()
Definition:
ProductSelectionDraftModel.php:113
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\Base\MapperMap\of
static of($data=null)
Definition:
MapperMap.php:45
Commercetools\Api\Models\Common\LocalizedString
Definition:
LocalizedString.php:14
Commercetools\Api\Models\ProductSelection\ProductSelectionDraft
Definition:
ProductSelectionDraft.php:17
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition:
CustomFieldsDraft.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\ProductSelection
Definition:
AssignedProductReference.php:9
Generated by
1.9.1