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
Zone
ZoneDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Zone
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
ZoneDraftModel
extends
JsonObjectModel
implements
ZoneDraft
21
{
26
protected
$key
;
27
32
protected
$name
;
33
38
protected
$description
;
39
44
protected
$locations
;
45
46
50
public
function
__construct
(
51
?
string
$key
=
null
,
52
?
string
$name
=
null
,
53
?
string
$description
=
null
,
54
?
LocationCollection
$locations
=
null
55
) {
56
$this->key =
$key
;
57
$this->name =
$name
;
58
$this->description =
$description
;
59
$this->locations =
$locations
;
60
}
61
68
public
function
getKey
()
69
{
70
if
(is_null($this->key)) {
72
$data = $this->
raw
(self::FIELD_KEY);
73
if
(is_null($data)) {
74
return
null
;
75
}
76
$this->key = (string) $data;
77
}
78
79
return
$this->key
;
80
}
81
88
public
function
getName
()
89
{
90
if
(is_null($this->name)) {
92
$data = $this->
raw
(self::FIELD_NAME);
93
if
(is_null($data)) {
94
return
null
;
95
}
96
$this->name = (string) $data;
97
}
98
99
return
$this->name
;
100
}
101
108
public
function
getDescription
()
109
{
110
if
(is_null($this->description)) {
112
$data = $this->
raw
(self::FIELD_DESCRIPTION);
113
if
(is_null($data)) {
114
return
null
;
115
}
116
$this->description = (string) $data;
117
}
118
119
return
$this->description
;
120
}
121
128
public
function
getLocations
()
129
{
130
if
(is_null($this->locations)) {
132
$data = $this->
raw
(self::FIELD_LOCATIONS);
133
if
(is_null($data)) {
134
return
null
;
135
}
136
$this->locations =
LocationCollection::fromArray
($data);
137
}
138
139
return
$this->locations
;
140
}
141
142
146
public
function
setKey
(?
string
$key
): void
147
{
148
$this->key =
$key
;
149
}
150
154
public
function
setName
(?
string
$name
): void
155
{
156
$this->name =
$name
;
157
}
158
162
public
function
setDescription
(?
string
$description
): void
163
{
164
$this->description =
$description
;
165
}
166
170
public
function
setLocations
(?
LocationCollection
$locations
): void
171
{
172
$this->locations =
$locations
;
173
}
174
}
Commercetools\Api\Models\Zone\LocationCollection
Definition
LocationCollection.php:22
Commercetools\Api\Models\Zone\ZoneDraftModel
Definition
ZoneDraftModel.php:21
Commercetools\Api\Models\Zone\ZoneDraftModel\$description
$description
Definition
ZoneDraftModel.php:38
Commercetools\Api\Models\Zone\ZoneDraftModel\$name
$name
Definition
ZoneDraftModel.php:32
Commercetools\Api\Models\Zone\ZoneDraftModel\getLocations
getLocations()
Definition
ZoneDraftModel.php:128
Commercetools\Api\Models\Zone\ZoneDraftModel\$key
$key
Definition
ZoneDraftModel.php:26
Commercetools\Api\Models\Zone\ZoneDraftModel\getName
getName()
Definition
ZoneDraftModel.php:88
Commercetools\Api\Models\Zone\ZoneDraftModel\setDescription
setDescription(?string $description)
Definition
ZoneDraftModel.php:162
Commercetools\Api\Models\Zone\ZoneDraftModel\setKey
setKey(?string $key)
Definition
ZoneDraftModel.php:146
Commercetools\Api\Models\Zone\ZoneDraftModel\$locations
$locations
Definition
ZoneDraftModel.php:44
Commercetools\Api\Models\Zone\ZoneDraftModel\setName
setName(?string $name)
Definition
ZoneDraftModel.php:154
Commercetools\Api\Models\Zone\ZoneDraftModel\__construct
__construct(?string $key=null, ?string $name=null, ?string $description=null, ?LocationCollection $locations=null)
Definition
ZoneDraftModel.php:50
Commercetools\Api\Models\Zone\ZoneDraftModel\setLocations
setLocations(?LocationCollection $locations)
Definition
ZoneDraftModel.php:170
Commercetools\Api\Models\Zone\ZoneDraftModel\getKey
getKey()
Definition
ZoneDraftModel.php:68
Commercetools\Api\Models\Zone\ZoneDraftModel\getDescription
getDescription()
Definition
ZoneDraftModel.php:108
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\Zone\ZoneDraft
Definition
ZoneDraft.php:15
Commercetools\Base\CSequence\fromArray
static fromArray(array $data)
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Zone
Definition
Location.php:9
Generated by
1.9.8