commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Me
MyTransactionDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Me
;
10
11
use
Commercetools\Api\Models\Common\Money
;
12
use
Commercetools\Api\Models\Common\MoneyBuilder
;
13
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
14
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
15
use
Commercetools\Base\Builder
;
16
use
Commercetools\Base\DateTimeImmutableCollection
;
17
use
Commercetools\Base\JsonObject
;
18
use
Commercetools\Base\JsonObjectModel
;
19
use
Commercetools\Base\MapperFactory
;
20
use DateTimeImmutable;
21
use stdClass;
22
26
final
class
MyTransactionDraftBuilder
implements
Builder
27
{
32
private
$timestamp;
33
38
private
$type;
39
44
private
$amount;
45
50
private
$interactionId;
51
56
private
$custom;
57
64
public
function
getTimestamp
()
65
{
66
return
$this->timestamp;
67
}
68
76
public
function
getType
()
77
{
78
return
$this->type;
79
}
80
87
public
function
getAmount
()
88
{
89
return
$this->amount instanceof
MoneyBuilder
? $this->amount->
build
() : $this->amount;
90
}
91
99
public
function
getInteractionId
()
100
{
101
return
$this->interactionId;
102
}
103
110
public
function
getCustom
()
111
{
112
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
113
}
114
119
public
function
withTimestamp
(?DateTimeImmutable $timestamp)
120
{
121
$this->timestamp = $timestamp;
122
123
return
$this;
124
}
125
130
public
function
withType
(?
string
$type)
131
{
132
$this->type = $type;
133
134
return
$this;
135
}
136
141
public
function
withAmount
(?
Money
$amount)
142
{
143
$this->amount = $amount;
144
145
return
$this;
146
}
147
152
public
function
withInteractionId
(?
string
$interactionId)
153
{
154
$this->interactionId = $interactionId;
155
156
return
$this;
157
}
158
163
public
function
withCustom
(?
CustomFieldsDraft
$custom)
164
{
165
$this->custom = $custom;
166
167
return
$this;
168
}
169
174
public
function
withAmountBuilder
(?
MoneyBuilder
$amount)
175
{
176
$this->amount = $amount;
177
178
return
$this;
179
}
180
185
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
186
{
187
$this->custom = $custom;
188
189
return
$this;
190
}
191
192
public
function
build
():
MyTransactionDraft
193
{
194
return
new
MyTransactionDraftModel
(
195
$this->timestamp,
196
$this->type,
197
$this->amount instanceof
MoneyBuilder
? $this->amount->
build
() : $this->amount,
198
$this->interactionId,
199
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
200
);
201
}
202
203
public
static
function
of
():
MyTransactionDraftBuilder
204
{
205
return
new
self
();
206
}
207
}
Commercetools\Api\Models\Common\MoneyBuilder
Definition:
MoneyBuilder.php:22
Commercetools\Api\Models\Common\MoneyBuilder\build
build()
Definition:
MoneyBuilder.php:84
Commercetools\Api\Models\Me\MyTransactionDraftBuilder
Definition:
MyTransactionDraftBuilder.php:27
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\getInteractionId
getInteractionId()
Definition:
MyTransactionDraftBuilder.php:99
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\getAmount
getAmount()
Definition:
MyTransactionDraftBuilder.php:87
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\withTimestamp
withTimestamp(?DateTimeImmutable $timestamp)
Definition:
MyTransactionDraftBuilder.php:119
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\getType
getType()
Definition:
MyTransactionDraftBuilder.php:76
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\getTimestamp
getTimestamp()
Definition:
MyTransactionDraftBuilder.php:64
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition:
MyTransactionDraftBuilder.php:185
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\build
build()
Definition:
MyTransactionDraftBuilder.php:192
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition:
MyTransactionDraftBuilder.php:163
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\of
static of()
Definition:
MyTransactionDraftBuilder.php:203
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\withAmountBuilder
withAmountBuilder(?MoneyBuilder $amount)
Definition:
MyTransactionDraftBuilder.php:174
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\withInteractionId
withInteractionId(?string $interactionId)
Definition:
MyTransactionDraftBuilder.php:152
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\withAmount
withAmount(?Money $amount)
Definition:
MyTransactionDraftBuilder.php:141
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\withType
withType(?string $type)
Definition:
MyTransactionDraftBuilder.php:130
Commercetools\Api\Models\Me\MyTransactionDraftBuilder\getCustom
getCustom()
Definition:
MyTransactionDraftBuilder.php:110
Commercetools\Api\Models\Me\MyTransactionDraftModel
Definition:
MyTransactionDraftModel.php:26
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\Money
Definition:
Money.php:15
Commercetools\Api\Models\Me\MyTransactionDraft
Definition:
MyTransactionDraft.php:18
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\Me
Definition:
MyBusinessUnitAddAddressAction.php:9
Generated by
1.9.1