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
100
public
function
getKey
()
101
{
102
if
(is_null($this->key)) {
104
$data = $this->
raw
(self::FIELD_KEY);
105
if
(is_null($data)) {
106
return
null
;
107
}
108
$this->key = (string) $data;
109
}
110
111
return
$this->key
;
112
}
113
122
public
function
getRoles
()
123
{
124
if
(is_null($this->roles)) {
126
$data = $this->
raw
(self::FIELD_ROLES);
127
if
(is_null($data)) {
128
return
null
;
129
}
130
$this->roles = $data;
131
}
132
133
return
$this->roles
;
134
}
135
142
public
function
getName
()
143
{
144
if
(is_null($this->name)) {
146
$data = $this->
raw
(self::FIELD_NAME);
147
if
(is_null($data)) {
148
return
null
;
149
}
150
151
$this->name = LocalizedStringModel::of($data);
152
}
153
154
return
$this->name
;
155
}
156
163
public
function
getDescription
()
164
{
165
if
(is_null($this->description)) {
167
$data = $this->
raw
(self::FIELD_DESCRIPTION);
168
if
(is_null($data)) {
169
return
null
;
170
}
171
172
$this->description = LocalizedStringModel::of($data);
173
}
174
175
return
$this->description
;
176
}
177
184
public
function
getAddress
()
185
{
186
if
(is_null($this->address)) {
188
$data = $this->
raw
(self::FIELD_ADDRESS);
189
if
(is_null($data)) {
190
return
null
;
191
}
192
193
$this->address = BaseAddressModel::of($data);
194
}
195
196
return
$this->address
;
197
}
198
205
public
function
getCustom
()
206
{
207
if
(is_null($this->custom)) {
209
$data = $this->
raw
(self::FIELD_CUSTOM);
210
if
(is_null($data)) {
211
return
null
;
212
}
213
214
$this->custom = CustomFieldsDraftModel::of($data);
215
}
216
217
return
$this->custom
;
218
}
219
227
public
function
getGeoLocation
()
228
{
229
if
(is_null($this->geoLocation)) {
231
$data = $this->
raw
(self::FIELD_GEO_LOCATION);
232
if
(is_null($data)) {
233
return
null
;
234
}
235
$className = GeoJsonModel::resolveDiscriminatorClass($data);
236
$this->geoLocation = $className::of($data);
237
}
238
239
return
$this->geoLocation
;
240
}
241
242
246
public
function
setKey
(?
string
$key
): void
247
{
248
$this->key =
$key
;
249
}
250
254
public
function
setRoles
(?array
$roles
): void
255
{
256
$this->roles =
$roles
;
257
}
258
262
public
function
setName
(?
LocalizedString
$name
): void
263
{
264
$this->name =
$name
;
265
}
266
270
public
function
setDescription
(?
LocalizedString
$description
): void
271
{
272
$this->description =
$description
;
273
}
274
278
public
function
setAddress
(?
BaseAddress
$address
): void
279
{
280
$this->address =
$address
;
281
}
282
286
public
function
setCustom
(?
CustomFieldsDraft
$custom
): void
287
{
288
$this->custom =
$custom
;
289
}
290
294
public
function
setGeoLocation
(?
GeoJson
$geoLocation
): void
295
{
296
$this->geoLocation =
$geoLocation
;
297
}
298
}
Commercetools\Api\Models\Channel\ChannelDraftModel
Definition
ChannelDraftModel.php:29
Commercetools\Api\Models\Channel\ChannelDraftModel\setGeoLocation
setGeoLocation(?GeoJson $geoLocation)
Definition
ChannelDraftModel.php:294
Commercetools\Api\Models\Channel\ChannelDraftModel\getDescription
getDescription()
Definition
ChannelDraftModel.php:163
Commercetools\Api\Models\Channel\ChannelDraftModel\getGeoLocation
getGeoLocation()
Definition
ChannelDraftModel.php:227
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:278
Commercetools\Api\Models\Channel\ChannelDraftModel\getAddress
getAddress()
Definition
ChannelDraftModel.php:184
Commercetools\Api\Models\Channel\ChannelDraftModel\setRoles
setRoles(?array $roles)
Definition
ChannelDraftModel.php:254
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:205
Commercetools\Api\Models\Channel\ChannelDraftModel\$key
$key
Definition
ChannelDraftModel.php:34
Commercetools\Api\Models\Channel\ChannelDraftModel\getKey
getKey()
Definition
ChannelDraftModel.php:100
Commercetools\Api\Models\Channel\ChannelDraftModel\$description
$description
Definition
ChannelDraftModel.php:52
Commercetools\Api\Models\Channel\ChannelDraftModel\setCustom
setCustom(?CustomFieldsDraft $custom)
Definition
ChannelDraftModel.php:286
Commercetools\Api\Models\Channel\ChannelDraftModel\setDescription
setDescription(?LocalizedString $description)
Definition
ChannelDraftModel.php:270
Commercetools\Api\Models\Channel\ChannelDraftModel\setKey
setKey(?string $key)
Definition
ChannelDraftModel.php:246
Commercetools\Api\Models\Channel\ChannelDraftModel\setName
setName(?LocalizedString $name)
Definition
ChannelDraftModel.php:262
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:122
Commercetools\Api\Models\Channel\ChannelDraftModel\getName
getName()
Definition
ChannelDraftModel.php:142
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