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
Channel
ChannelDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Channel
;
10
11
use
Commercetools\Api\Models\Common\BaseAddress
;
12
use
Commercetools\Api\Models\Common\BaseAddressModel
;
13
use
Commercetools\Api\Models\Common\GeoJson
;
14
use
Commercetools\Api\Models\Common\GeoJsonModel
;
15
use
Commercetools\Api\Models\Common\LocalizedString
;
16
use
Commercetools\Api\Models\Common\LocalizedStringModel
;
17
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
18
use
Commercetools\Api\Models\Type\CustomFieldsDraftModel
;
19
use
Commercetools\Base\DateTimeImmutableCollection
;
20
use
Commercetools\Base\JsonObject
;
21
use
Commercetools\Base\JsonObjectModel
;
22
use
Commercetools\Base\MapperFactory
;
23
use stdClass;
24
28
final
class
ChannelDraftModel
extends
JsonObjectModel
implements
ChannelDraft
29
{
34
protected
$key
;
35
40
protected
$roles
;
41
46
protected
$name
;
47
52
protected
$description
;
53
58
protected
$address
;
59
64
protected
$custom
;
65
70
protected
$geoLocation
;
71
72
76
public
function
__construct
(
77
?
string
$key
=
null
,
78
?array
$roles
=
null
,
79
?
LocalizedString
$name
=
null
,
80
?
LocalizedString
$description
=
null
,
81
?
BaseAddress
$address
=
null
,
82
?
CustomFieldsDraft
$custom
=
null
,
83
?
GeoJson
$geoLocation
=
null
84
) {
85
$this->key =
$key
;
86
$this->roles =
$roles
;
87
$this->name =
$name
;
88
$this->description =
$description
;
89
$this->address =
$address
;
90
$this->custom =
$custom
;
91
$this->geoLocation =
$geoLocation
;
92
}
93
102
public
function
getKey
()
103
{
104
if
(is_null($this->key)) {
106
$data = $this->
raw
(self::FIELD_KEY);
107
if
(is_null($data)) {
108
return
null
;
109
}
110
$this->key = (string) $data;
111
}
112
113
return
$this->key
;
114
}
115
123
public
function
getRoles
()
124
{
125
if
(is_null($this->roles)) {
127
$data = $this->
raw
(self::FIELD_ROLES);
128
if
(is_null($data)) {
129
return
null
;
130
}
131
$this->roles = $data;
132
}
133
134
return
$this->roles
;
135
}
136
143
public
function
getName
()
144
{
145
if
(is_null($this->name)) {
147
$data = $this->
raw
(self::FIELD_NAME);
148
if
(is_null($data)) {
149
return
null
;
150
}
151
152
$this->name = LocalizedStringModel::of($data);
153
}
154
155
return
$this->name
;
156
}
157
164
public
function
getDescription
()
165
{
166
if
(is_null($this->description)) {
168
$data = $this->
raw
(self::FIELD_DESCRIPTION);
169
if
(is_null($data)) {
170
return
null
;
171
}
172
173
$this->description = LocalizedStringModel::of($data);
174
}
175
176
return
$this->description
;
177
}
178
185
public
function
getAddress
()
186
{
187
if
(is_null($this->address)) {
189
$data = $this->
raw
(self::FIELD_ADDRESS);
190
if
(is_null($data)) {
191
return
null
;
192
}
193
194
$this->address = BaseAddressModel::of($data);
195
}
196
197
return
$this->address
;
198
}
199
206
public
function
getCustom
()
207
{
208
if
(is_null($this->custom)) {
210
$data = $this->
raw
(self::FIELD_CUSTOM);
211
if
(is_null($data)) {
212
return
null
;
213
}
214
215
$this->custom = CustomFieldsDraftModel::of($data);
216
}
217
218
return
$this->custom
;
219
}
220
228
public
function
getGeoLocation
()
229
{
230
if
(is_null($this->geoLocation)) {
232
$data = $this->
raw
(self::FIELD_GEO_LOCATION);
233
if
(is_null($data)) {
234
return
null
;
235
}
236
$className = GeoJsonModel::resolveDiscriminatorClass($data);
237
$this->geoLocation = $className::of($data);
238
}
239
240
return
$this->geoLocation
;
241
}
242
243
247
public
function
setKey
(?
string
$key
): void
248
{
249
$this->key =
$key
;
250
}
251
255
public
function
setRoles
(?array
$roles
): void
256
{
257
$this->roles =
$roles
;
258
}
259
263
public
function
setName
(?
LocalizedString
$name
): void
264
{
265
$this->name =
$name
;
266
}
267
271
public
function
setDescription
(?
LocalizedString
$description
): void
272
{
273
$this->description =
$description
;
274
}
275
279
public
function
setAddress
(?
BaseAddress
$address
): void
280
{
281
$this->address =
$address
;
282
}
283
287
public
function
setCustom
(?
CustomFieldsDraft
$custom
): void
288
{
289
$this->custom =
$custom
;
290
}
291
295
public
function
setGeoLocation
(?
GeoJson
$geoLocation
): void
296
{
297
$this->geoLocation =
$geoLocation
;
298
}
299
}
Commercetools\Api\Models\Channel\ChannelDraftModel
Definition
ChannelDraftModel.php:29
Commercetools\Api\Models\Channel\ChannelDraftModel\setGeoLocation
setGeoLocation(?GeoJson $geoLocation)
Definition
ChannelDraftModel.php:295
Commercetools\Api\Models\Channel\ChannelDraftModel\getDescription
getDescription()
Definition
ChannelDraftModel.php:164
Commercetools\Api\Models\Channel\ChannelDraftModel\getGeoLocation
getGeoLocation()
Definition
ChannelDraftModel.php:228
Commercetools\Api\Models\Channel\ChannelDraftModel\__construct
__construct(?string $key=null, ?array $roles=null, ?LocalizedString $name=null, ?LocalizedString $description=null, ?BaseAddress $address=null, ?CustomFieldsDraft $custom=null, ?GeoJson $geoLocation=null)
Definition
ChannelDraftModel.php:76
Commercetools\Api\Models\Channel\ChannelDraftModel\setAddress
setAddress(?BaseAddress $address)
Definition
ChannelDraftModel.php:279
Commercetools\Api\Models\Channel\ChannelDraftModel\getAddress
getAddress()
Definition
ChannelDraftModel.php:185
Commercetools\Api\Models\Channel\ChannelDraftModel\setRoles
setRoles(?array $roles)
Definition
ChannelDraftModel.php:255
Commercetools\Api\Models\Channel\ChannelDraftModel\$roles
$roles
Definition
ChannelDraftModel.php:40
Commercetools\Api\Models\Channel\ChannelDraftModel\$name
$name
Definition
ChannelDraftModel.php:46
Commercetools\Api\Models\Channel\ChannelDraftModel\$custom
$custom
Definition
ChannelDraftModel.php:64
Commercetools\Api\Models\Channel\ChannelDraftModel\getCustom
getCustom()
Definition
ChannelDraftModel.php:206
Commercetools\Api\Models\Channel\ChannelDraftModel\$key
$key
Definition
ChannelDraftModel.php:34
Commercetools\Api\Models\Channel\ChannelDraftModel\getKey
getKey()
Definition
ChannelDraftModel.php:102
Commercetools\Api\Models\Channel\ChannelDraftModel\$description
$description
Definition
ChannelDraftModel.php:52
Commercetools\Api\Models\Channel\ChannelDraftModel\setCustom
setCustom(?CustomFieldsDraft $custom)
Definition
ChannelDraftModel.php:287
Commercetools\Api\Models\Channel\ChannelDraftModel\setDescription
setDescription(?LocalizedString $description)
Definition
ChannelDraftModel.php:271
Commercetools\Api\Models\Channel\ChannelDraftModel\setKey
setKey(?string $key)
Definition
ChannelDraftModel.php:247
Commercetools\Api\Models\Channel\ChannelDraftModel\setName
setName(?LocalizedString $name)
Definition
ChannelDraftModel.php:263
Commercetools\Api\Models\Channel\ChannelDraftModel\$address
$address
Definition
ChannelDraftModel.php:58
Commercetools\Api\Models\Channel\ChannelDraftModel\$geoLocation
$geoLocation
Definition
ChannelDraftModel.php:70
Commercetools\Api\Models\Channel\ChannelDraftModel\getRoles
getRoles()
Definition
ChannelDraftModel.php:123
Commercetools\Api\Models\Channel\ChannelDraftModel\getName
getName()
Definition
ChannelDraftModel.php:143
Commercetools\Api\Models\Common\BaseAddressModel
Definition
BaseAddressModel.php:21
Commercetools\Api\Models\Common\GeoJsonModel
Definition
GeoJsonModel.php:21
Commercetools\Api\Models\Common\LocalizedStringModel
Definition
LocalizedStringModel.php:17
Commercetools\Api\Models\Type\CustomFieldsDraftModel
Definition
CustomFieldsDraftModel.php:21
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\Channel\ChannelDraft
Definition
ChannelDraft.php:19
Commercetools\Api\Models\Common\BaseAddress
Definition
BaseAddress.php:15
Commercetools\Api\Models\Common\GeoJson
Definition
GeoJson.php:15
Commercetools\Api\Models\Common\LocalizedString
Definition
LocalizedString.php:14
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Channel
Definition
Channel.php:9
Generated by
1.9.8