commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Common
AssetDraftBuilder.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\CustomFieldsDraftBuilder
;
13
use
Commercetools\Base\Builder
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
AssetDraftBuilder
implements
Builder
24
{
29
private
$sources;
30
35
private
$name;
36
41
private
$description;
42
47
private
$tags;
48
53
private
$custom;
54
59
private
$key;
60
65
public
function
getSources
()
66
{
67
return
$this->sources;
68
}
69
76
public
function
getName
()
77
{
78
return
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name;
79
}
80
87
public
function
getDescription
()
88
{
89
return
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description;
90
}
91
98
public
function
getTags
()
99
{
100
return
$this->tags;
101
}
102
109
public
function
getCustom
()
110
{
111
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
112
}
113
120
public
function
getKey
()
121
{
122
return
$this->key;
123
}
124
129
public
function
withSources
(?
AssetSourceCollection
$sources)
130
{
131
$this->sources = $sources;
132
133
return
$this;
134
}
135
140
public
function
withName
(?
LocalizedString
$name)
141
{
142
$this->name = $name;
143
144
return
$this;
145
}
146
151
public
function
withDescription
(?
LocalizedString
$description)
152
{
153
$this->description = $description;
154
155
return
$this;
156
}
157
162
public
function
withTags
(?array $tags)
163
{
164
$this->tags = $tags;
165
166
return
$this;
167
}
168
173
public
function
withCustom
(?
CustomFieldsDraft
$custom)
174
{
175
$this->custom = $custom;
176
177
return
$this;
178
}
179
184
public
function
withKey
(?
string
$key)
185
{
186
$this->key = $key;
187
188
return
$this;
189
}
190
195
public
function
withNameBuilder
(?
LocalizedStringBuilder
$name)
196
{
197
$this->name = $name;
198
199
return
$this;
200
}
201
206
public
function
withDescriptionBuilder
(?
LocalizedStringBuilder
$description)
207
{
208
$this->description = $description;
209
210
return
$this;
211
}
212
217
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
218
{
219
$this->custom = $custom;
220
221
return
$this;
222
}
223
224
public
function
build
():
AssetDraft
225
{
226
return
new
AssetDraftModel
(
227
$this->sources,
228
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name,
229
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description,
230
$this->tags,
231
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom,
232
$this->key
233
);
234
}
235
236
public
static
function
of
():
AssetDraftBuilder
237
{
238
return
new
self
();
239
}
240
}
Commercetools\Api\Models\Common\AssetDraftBuilder
Definition:
AssetDraftBuilder.php:24
Commercetools\Api\Models\Common\AssetDraftBuilder\withName
withName(?LocalizedString $name)
Definition:
AssetDraftBuilder.php:140
Commercetools\Api\Models\Common\AssetDraftBuilder\getDescription
getDescription()
Definition:
AssetDraftBuilder.php:87
Commercetools\Api\Models\Common\AssetDraftBuilder\getName
getName()
Definition:
AssetDraftBuilder.php:76
Commercetools\Api\Models\Common\AssetDraftBuilder\getCustom
getCustom()
Definition:
AssetDraftBuilder.php:109
Commercetools\Api\Models\Common\AssetDraftBuilder\of
static of()
Definition:
AssetDraftBuilder.php:236
Commercetools\Api\Models\Common\AssetDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition:
AssetDraftBuilder.php:217
Commercetools\Api\Models\Common\AssetDraftBuilder\withDescription
withDescription(?LocalizedString $description)
Definition:
AssetDraftBuilder.php:151
Commercetools\Api\Models\Common\AssetDraftBuilder\getKey
getKey()
Definition:
AssetDraftBuilder.php:120
Commercetools\Api\Models\Common\AssetDraftBuilder\build
build()
Definition:
AssetDraftBuilder.php:224
Commercetools\Api\Models\Common\AssetDraftBuilder\getSources
getSources()
Definition:
AssetDraftBuilder.php:65
Commercetools\Api\Models\Common\AssetDraftBuilder\withKey
withKey(?string $key)
Definition:
AssetDraftBuilder.php:184
Commercetools\Api\Models\Common\AssetDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition:
AssetDraftBuilder.php:173
Commercetools\Api\Models\Common\AssetDraftBuilder\withTags
withTags(?array $tags)
Definition:
AssetDraftBuilder.php:162
Commercetools\Api\Models\Common\AssetDraftBuilder\withDescriptionBuilder
withDescriptionBuilder(?LocalizedStringBuilder $description)
Definition:
AssetDraftBuilder.php:206
Commercetools\Api\Models\Common\AssetDraftBuilder\withNameBuilder
withNameBuilder(?LocalizedStringBuilder $name)
Definition:
AssetDraftBuilder.php:195
Commercetools\Api\Models\Common\AssetDraftBuilder\withSources
withSources(?AssetSourceCollection $sources)
Definition:
AssetDraftBuilder.php:129
Commercetools\Api\Models\Common\AssetDraftBuilder\getTags
getTags()
Definition:
AssetDraftBuilder.php:98
Commercetools\Api\Models\Common\AssetDraftModel
Definition:
AssetDraftModel.php:23
Commercetools\Api\Models\Common\AssetSourceCollection
Definition:
AssetSourceCollection.php:22
Commercetools\Api\Models\Common\LocalizedStringBuilder
Definition:
LocalizedStringBuilder.php:20
Commercetools\Api\Models\Common\LocalizedStringBuilder\build
build()
Definition:
LocalizedStringBuilder.php:42
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition:
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition:
CustomFieldsDraftBuilder.php:101
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\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Common
Definition:
Address.php:9
Generated by
1.9.1