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
Common
AssetDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Common
;
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
AssetDraftModel
extends
JsonObjectModel
implements
AssetDraft
23
{
28
protected
$sources
;
29
34
protected
$name
;
35
40
protected
$description
;
41
46
protected
$tags
;
47
52
protected
$custom
;
53
58
protected
$key
;
59
60
64
public
function
__construct
(
65
?
AssetSourceCollection
$sources
=
null
,
66
?
LocalizedString
$name
=
null
,
67
?
LocalizedString
$description
=
null
,
68
?array
$tags
=
null
,
69
?
CustomFieldsDraft
$custom
=
null
,
70
?
string
$key
=
null
71
) {
72
$this->sources =
$sources
;
73
$this->name =
$name
;
74
$this->description =
$description
;
75
$this->tags =
$tags
;
76
$this->custom =
$custom
;
77
$this->key =
$key
;
78
}
79
84
public
function
getSources
()
85
{
86
if
(is_null($this->sources)) {
88
$data = $this->
raw
(self::FIELD_SOURCES);
89
if
(is_null($data)) {
90
return
null
;
91
}
92
$this->sources =
AssetSourceCollection::fromArray
($data);
93
}
94
95
return
$this->sources
;
96
}
97
104
public
function
getName
()
105
{
106
if
(is_null($this->name)) {
108
$data = $this->
raw
(self::FIELD_NAME);
109
if
(is_null($data)) {
110
return
null
;
111
}
112
113
$this->name =
LocalizedStringModel::of
($data);
114
}
115
116
return
$this->name
;
117
}
118
125
public
function
getDescription
()
126
{
127
if
(is_null($this->description)) {
129
$data = $this->
raw
(self::FIELD_DESCRIPTION);
130
if
(is_null($data)) {
131
return
null
;
132
}
133
134
$this->description =
LocalizedStringModel::of
($data);
135
}
136
137
return
$this->description
;
138
}
139
146
public
function
getTags
()
147
{
148
if
(is_null($this->tags)) {
150
$data = $this->
raw
(self::FIELD_TAGS);
151
if
(is_null($data)) {
152
return
null
;
153
}
154
$this->tags = $data;
155
}
156
157
return
$this->tags
;
158
}
159
166
public
function
getCustom
()
167
{
168
if
(is_null($this->custom)) {
170
$data = $this->
raw
(self::FIELD_CUSTOM);
171
if
(is_null($data)) {
172
return
null
;
173
}
174
175
$this->custom = CustomFieldsDraftModel::of($data);
176
}
177
178
return
$this->custom
;
179
}
180
187
public
function
getKey
()
188
{
189
if
(is_null($this->key)) {
191
$data = $this->
raw
(self::FIELD_KEY);
192
if
(is_null($data)) {
193
return
null
;
194
}
195
$this->key = (string) $data;
196
}
197
198
return
$this->key
;
199
}
200
201
205
public
function
setSources
(?
AssetSourceCollection
$sources
): void
206
{
207
$this->sources =
$sources
;
208
}
209
213
public
function
setName
(?
LocalizedString
$name
): void
214
{
215
$this->name =
$name
;
216
}
217
221
public
function
setDescription
(?
LocalizedString
$description
): void
222
{
223
$this->description =
$description
;
224
}
225
229
public
function
setTags
(?array
$tags
): void
230
{
231
$this->tags =
$tags
;
232
}
233
237
public
function
setCustom
(?
CustomFieldsDraft
$custom
): void
238
{
239
$this->custom =
$custom
;
240
}
241
245
public
function
setKey
(?
string
$key
): void
246
{
247
$this->key =
$key
;
248
}
249
}
Commercetools\Api\Models\Common\AssetDraftModel
Definition
AssetDraftModel.php:23
Commercetools\Api\Models\Common\AssetDraftModel\$key
$key
Definition
AssetDraftModel.php:58
Commercetools\Api\Models\Common\AssetDraftModel\setKey
setKey(?string $key)
Definition
AssetDraftModel.php:245
Commercetools\Api\Models\Common\AssetDraftModel\setName
setName(?LocalizedString $name)
Definition
AssetDraftModel.php:213
Commercetools\Api\Models\Common\AssetDraftModel\getDescription
getDescription()
Definition
AssetDraftModel.php:125
Commercetools\Api\Models\Common\AssetDraftModel\__construct
__construct(?AssetSourceCollection $sources=null, ?LocalizedString $name=null, ?LocalizedString $description=null, ?array $tags=null, ?CustomFieldsDraft $custom=null, ?string $key=null)
Definition
AssetDraftModel.php:64
Commercetools\Api\Models\Common\AssetDraftModel\$name
$name
Definition
AssetDraftModel.php:34
Commercetools\Api\Models\Common\AssetDraftModel\setSources
setSources(?AssetSourceCollection $sources)
Definition
AssetDraftModel.php:205
Commercetools\Api\Models\Common\AssetDraftModel\setCustom
setCustom(?CustomFieldsDraft $custom)
Definition
AssetDraftModel.php:237
Commercetools\Api\Models\Common\AssetDraftModel\setDescription
setDescription(?LocalizedString $description)
Definition
AssetDraftModel.php:221
Commercetools\Api\Models\Common\AssetDraftModel\$tags
$tags
Definition
AssetDraftModel.php:46
Commercetools\Api\Models\Common\AssetDraftModel\getSources
getSources()
Definition
AssetDraftModel.php:84
Commercetools\Api\Models\Common\AssetDraftModel\getTags
getTags()
Definition
AssetDraftModel.php:146
Commercetools\Api\Models\Common\AssetDraftModel\$description
$description
Definition
AssetDraftModel.php:40
Commercetools\Api\Models\Common\AssetDraftModel\getKey
getKey()
Definition
AssetDraftModel.php:187
Commercetools\Api\Models\Common\AssetDraftModel\getName
getName()
Definition
AssetDraftModel.php:104
Commercetools\Api\Models\Common\AssetDraftModel\$custom
$custom
Definition
AssetDraftModel.php:52
Commercetools\Api\Models\Common\AssetDraftModel\setTags
setTags(?array $tags)
Definition
AssetDraftModel.php:229
Commercetools\Api\Models\Common\AssetDraftModel\$sources
$sources
Definition
AssetDraftModel.php:28
Commercetools\Api\Models\Common\AssetDraftModel\getCustom
getCustom()
Definition
AssetDraftModel.php:166
Commercetools\Api\Models\Common\AssetSourceCollection
Definition
AssetSourceCollection.php:22
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\Common\AssetDraft
Definition
AssetDraft.php:16
Commercetools\Api\Models\Common\LocalizedString
Definition
LocalizedString.php:14
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\CMap\of
static of($data=null)
Commercetools\Base\CSequence\fromArray
static fromArray(array $data)
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Common
Definition
Address.php:9
Generated by
1.9.8