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
State
StateDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\State
;
10
11
use
Commercetools\Api\Models\Common\LocalizedString
;
12
use
Commercetools\Api\Models\Common\LocalizedStringBuilder
;
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
StateDraftBuilder
implements
Builder
24
{
29
private
$key;
30
35
private
$type;
36
41
private
$name;
42
47
private
$description;
48
53
private
$initial;
54
59
private
$roles;
60
65
private
$transitions;
66
73
public
function
getKey
()
74
{
75
return
$this->key;
76
}
77
84
public
function
getType
()
85
{
86
return
$this->type;
87
}
88
95
public
function
getName
()
96
{
97
return
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name;
98
}
99
106
public
function
getDescription
()
107
{
108
return
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description;
109
}
110
117
public
function
getInitial
()
118
{
119
return
$this->initial;
120
}
121
128
public
function
getRoles
()
129
{
130
return
$this->roles;
131
}
132
144
public
function
getTransitions
()
145
{
146
return
$this->transitions;
147
}
148
153
public
function
withKey
(?
string
$key)
154
{
155
$this->key = $key;
156
157
return
$this;
158
}
159
164
public
function
withType
(?
string
$type)
165
{
166
$this->type = $type;
167
168
return
$this;
169
}
170
175
public
function
withName
(?
LocalizedString
$name)
176
{
177
$this->name = $name;
178
179
return
$this;
180
}
181
186
public
function
withDescription
(?
LocalizedString
$description)
187
{
188
$this->description = $description;
189
190
return
$this;
191
}
192
197
public
function
withInitial
(?
bool
$initial)
198
{
199
$this->initial = $initial;
200
201
return
$this;
202
}
203
208
public
function
withRoles
(?array $roles)
209
{
210
$this->roles = $roles;
211
212
return
$this;
213
}
214
219
public
function
withTransitions
(?
StateResourceIdentifierCollection
$transitions)
220
{
221
$this->transitions = $transitions;
222
223
return
$this;
224
}
225
230
public
function
withNameBuilder
(?
LocalizedStringBuilder
$name)
231
{
232
$this->name = $name;
233
234
return
$this;
235
}
236
241
public
function
withDescriptionBuilder
(?
LocalizedStringBuilder
$description)
242
{
243
$this->description = $description;
244
245
return
$this;
246
}
247
248
public
function
build
():
StateDraft
249
{
250
return
new
StateDraftModel
(
251
$this->key,
252
$this->type,
253
$this->name instanceof
LocalizedStringBuilder
? $this->name->
build
() : $this->name,
254
$this->description instanceof
LocalizedStringBuilder
? $this->description->
build
() : $this->description,
255
$this->initial,
256
$this->roles,
257
$this->transitions
258
);
259
}
260
261
public
static
function
of
():
StateDraftBuilder
262
{
263
return
new
self
();
264
}
265
}
Commercetools\Api\Models\Common\LocalizedStringBuilder
Definition
LocalizedStringBuilder.php:20
Commercetools\Api\Models\Common\LocalizedStringBuilder\build
build()
Definition
LocalizedStringBuilder.php:42
Commercetools\Api\Models\State\StateDraftBuilder
Definition
StateDraftBuilder.php:24
Commercetools\Api\Models\State\StateDraftBuilder\getRoles
getRoles()
Definition
StateDraftBuilder.php:128
Commercetools\Api\Models\State\StateDraftBuilder\withKey
withKey(?string $key)
Definition
StateDraftBuilder.php:153
Commercetools\Api\Models\State\StateDraftBuilder\withRoles
withRoles(?array $roles)
Definition
StateDraftBuilder.php:208
Commercetools\Api\Models\State\StateDraftBuilder\build
build()
Definition
StateDraftBuilder.php:248
Commercetools\Api\Models\State\StateDraftBuilder\withName
withName(?LocalizedString $name)
Definition
StateDraftBuilder.php:175
Commercetools\Api\Models\State\StateDraftBuilder\withTransitions
withTransitions(?StateResourceIdentifierCollection $transitions)
Definition
StateDraftBuilder.php:219
Commercetools\Api\Models\State\StateDraftBuilder\getType
getType()
Definition
StateDraftBuilder.php:84
Commercetools\Api\Models\State\StateDraftBuilder\withNameBuilder
withNameBuilder(?LocalizedStringBuilder $name)
Definition
StateDraftBuilder.php:230
Commercetools\Api\Models\State\StateDraftBuilder\getName
getName()
Definition
StateDraftBuilder.php:95
Commercetools\Api\Models\State\StateDraftBuilder\withDescriptionBuilder
withDescriptionBuilder(?LocalizedStringBuilder $description)
Definition
StateDraftBuilder.php:241
Commercetools\Api\Models\State\StateDraftBuilder\getInitial
getInitial()
Definition
StateDraftBuilder.php:117
Commercetools\Api\Models\State\StateDraftBuilder\getTransitions
getTransitions()
Definition
StateDraftBuilder.php:144
Commercetools\Api\Models\State\StateDraftBuilder\withType
withType(?string $type)
Definition
StateDraftBuilder.php:164
Commercetools\Api\Models\State\StateDraftBuilder\getDescription
getDescription()
Definition
StateDraftBuilder.php:106
Commercetools\Api\Models\State\StateDraftBuilder\withDescription
withDescription(?LocalizedString $description)
Definition
StateDraftBuilder.php:186
Commercetools\Api\Models\State\StateDraftBuilder\of
static of()
Definition
StateDraftBuilder.php:261
Commercetools\Api\Models\State\StateDraftBuilder\getKey
getKey()
Definition
StateDraftBuilder.php:73
Commercetools\Api\Models\State\StateDraftBuilder\withInitial
withInitial(?bool $initial)
Definition
StateDraftBuilder.php:197
Commercetools\Api\Models\State\StateDraftModel
Definition
StateDraftModel.php:23
Commercetools\Api\Models\State\StateResourceIdentifierCollection
Definition
StateResourceIdentifierCollection.php:22
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\LocalizedString
Definition
LocalizedString.php:14
Commercetools\Api\Models\State\StateDraft
Definition
StateDraft.php:16
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\State
Definition
State.php:9
Generated by
1.9.8