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
Quote
QuoteDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Quote
;
10
11
use
Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifier
;
12
use
Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifierBuilder
;
13
use
Commercetools\Api\Models\State\StateReference
;
14
use
Commercetools\Api\Models\State\StateReferenceBuilder
;
15
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
16
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
17
use
Commercetools\Base\Builder
;
18
use
Commercetools\Base\DateTimeImmutableCollection
;
19
use
Commercetools\Base\JsonObject
;
20
use
Commercetools\Base\JsonObjectModel
;
21
use
Commercetools\Base\MapperFactory
;
22
use stdClass;
23
27
final
class
QuoteDraftBuilder
implements
Builder
28
{
33
private
$key;
34
39
private
$stagedQuote;
40
45
private
$stagedQuoteVersion;
46
51
private
$stagedQuoteStateToSent;
52
57
private
$state;
58
63
private
$custom;
64
71
public
function
getKey
()
72
{
73
return
$this->key;
74
}
75
82
public
function
getStagedQuote
()
83
{
84
return
$this->stagedQuote instanceof
StagedQuoteResourceIdentifierBuilder
? $this->stagedQuote->
build
() : $this->stagedQuote;
85
}
86
93
public
function
getStagedQuoteVersion
()
94
{
95
return
$this->stagedQuoteVersion;
96
}
97
104
public
function
getStagedQuoteStateToSent
()
105
{
106
return
$this->stagedQuoteStateToSent;
107
}
108
116
public
function
getState
()
117
{
118
return
$this->state instanceof
StateReferenceBuilder
? $this->state->
build
() : $this->state;
119
}
120
131
public
function
getCustom
()
132
{
133
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
134
}
135
140
public
function
withKey
(?
string
$key)
141
{
142
$this->key = $key;
143
144
return
$this;
145
}
146
151
public
function
withStagedQuote
(?
StagedQuoteResourceIdentifier
$stagedQuote)
152
{
153
$this->stagedQuote = $stagedQuote;
154
155
return
$this;
156
}
157
162
public
function
withStagedQuoteVersion
(?
int
$stagedQuoteVersion)
163
{
164
$this->stagedQuoteVersion = $stagedQuoteVersion;
165
166
return
$this;
167
}
168
173
public
function
withStagedQuoteStateToSent
(?
bool
$stagedQuoteStateToSent)
174
{
175
$this->stagedQuoteStateToSent = $stagedQuoteStateToSent;
176
177
return
$this;
178
}
179
184
public
function
withState
(?
StateReference
$state)
185
{
186
$this->state = $state;
187
188
return
$this;
189
}
190
195
public
function
withCustom
(?
CustomFieldsDraft
$custom)
196
{
197
$this->custom = $custom;
198
199
return
$this;
200
}
201
206
public
function
withStagedQuoteBuilder
(?
StagedQuoteResourceIdentifierBuilder
$stagedQuote)
207
{
208
$this->stagedQuote = $stagedQuote;
209
210
return
$this;
211
}
212
217
public
function
withStateBuilder
(?
StateReferenceBuilder
$state)
218
{
219
$this->state = $state;
220
221
return
$this;
222
}
223
228
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
229
{
230
$this->custom = $custom;
231
232
return
$this;
233
}
234
235
public
function
build
():
QuoteDraft
236
{
237
return
new
QuoteDraftModel
(
238
$this->key,
239
$this->stagedQuote instanceof
StagedQuoteResourceIdentifierBuilder
? $this->stagedQuote->
build
() : $this->stagedQuote,
240
$this->stagedQuoteVersion,
241
$this->stagedQuoteStateToSent,
242
$this->state instanceof
StateReferenceBuilder
? $this->state->
build
() : $this->state,
243
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
244
);
245
}
246
247
public
static
function
of
():
QuoteDraftBuilder
248
{
249
return
new
self
();
250
}
251
}
Commercetools\Api\Models\Quote\QuoteDraftBuilder
Definition
QuoteDraftBuilder.php:28
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withStagedQuote
withStagedQuote(?StagedQuoteResourceIdentifier $stagedQuote)
Definition
QuoteDraftBuilder.php:151
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
QuoteDraftBuilder.php:195
Commercetools\Api\Models\Quote\QuoteDraftBuilder\build
build()
Definition
QuoteDraftBuilder.php:235
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withStagedQuoteStateToSent
withStagedQuoteStateToSent(?bool $stagedQuoteStateToSent)
Definition
QuoteDraftBuilder.php:173
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withState
withState(?StateReference $state)
Definition
QuoteDraftBuilder.php:184
Commercetools\Api\Models\Quote\QuoteDraftBuilder\getState
getState()
Definition
QuoteDraftBuilder.php:116
Commercetools\Api\Models\Quote\QuoteDraftBuilder\getStagedQuoteVersion
getStagedQuoteVersion()
Definition
QuoteDraftBuilder.php:93
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withStateBuilder
withStateBuilder(?StateReferenceBuilder $state)
Definition
QuoteDraftBuilder.php:217
Commercetools\Api\Models\Quote\QuoteDraftBuilder\getStagedQuote
getStagedQuote()
Definition
QuoteDraftBuilder.php:82
Commercetools\Api\Models\Quote\QuoteDraftBuilder\getCustom
getCustom()
Definition
QuoteDraftBuilder.php:131
Commercetools\Api\Models\Quote\QuoteDraftBuilder\of
static of()
Definition
QuoteDraftBuilder.php:247
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withKey
withKey(?string $key)
Definition
QuoteDraftBuilder.php:140
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
QuoteDraftBuilder.php:228
Commercetools\Api\Models\Quote\QuoteDraftBuilder\getKey
getKey()
Definition
QuoteDraftBuilder.php:71
Commercetools\Api\Models\Quote\QuoteDraftBuilder\getStagedQuoteStateToSent
getStagedQuoteStateToSent()
Definition
QuoteDraftBuilder.php:104
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withStagedQuoteVersion
withStagedQuoteVersion(?int $stagedQuoteVersion)
Definition
QuoteDraftBuilder.php:162
Commercetools\Api\Models\Quote\QuoteDraftBuilder\withStagedQuoteBuilder
withStagedQuoteBuilder(?StagedQuoteResourceIdentifierBuilder $stagedQuote)
Definition
QuoteDraftBuilder.php:206
Commercetools\Api\Models\Quote\QuoteDraftModel
Definition
QuoteDraftModel.php:27
Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifierBuilder
Definition
StagedQuoteResourceIdentifierBuilder.php:24
Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifierBuilder\build
build()
Definition
StagedQuoteResourceIdentifierBuilder.php:82
Commercetools\Api\Models\State\StateReferenceBuilder
Definition
StateReferenceBuilder.php:24
Commercetools\Api\Models\State\StateReferenceBuilder\build
build()
Definition
StateReferenceBuilder.php:92
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\Quote\QuoteDraft
Definition
QuoteDraft.php:18
Commercetools\Api\Models\StagedQuote\StagedQuoteResourceIdentifier
Definition
StagedQuoteResourceIdentifier.php:16
Commercetools\Api\Models\State\StateReference
Definition
StateReference.php:16
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\Quote
Definition
Quote.php:9
Generated by
1.9.8