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
Cart
PaymentAllocationDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Cart
;
10
11
use
Commercetools\Api\Models\PaymentMethod\PaymentMethodReference
;
12
use
Commercetools\Api\Models\PaymentMethod\PaymentMethodReferenceBuilder
;
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
PaymentAllocationDraftBuilder
implements
Builder
24
{
29
private
$id;
30
35
private
$paymentMethod;
36
41
private
$allocation;
42
49
public
function
getId
()
50
{
51
return
$this->id;
52
}
53
60
public
function
getPaymentMethod
()
61
{
62
return
$this->paymentMethod instanceof
PaymentMethodReferenceBuilder
? $this->paymentMethod->
build
() : $this->paymentMethod;
63
}
64
71
public
function
getAllocation
()
72
{
73
return
$this->allocation instanceof
AllocationDraftBuilder
? $this->allocation->
build
() : $this->allocation;
74
}
75
80
public
function
withId
(?
string
$id)
81
{
82
$this->
id
= $id;
83
84
return
$this;
85
}
86
91
public
function
withPaymentMethod
(?
PaymentMethodReference
$paymentMethod)
92
{
93
$this->paymentMethod = $paymentMethod;
94
95
return
$this;
96
}
97
102
public
function
withAllocation
(?
AllocationDraft
$allocation)
103
{
104
$this->allocation = $allocation;
105
106
return
$this;
107
}
108
113
public
function
withPaymentMethodBuilder
(?
PaymentMethodReferenceBuilder
$paymentMethod)
114
{
115
$this->paymentMethod = $paymentMethod;
116
117
return
$this;
118
}
119
124
public
function
withAllocationBuilder
(?
AllocationDraftBuilder
$allocation)
125
{
126
$this->allocation = $allocation;
127
128
return
$this;
129
}
130
131
public
function
build
():
PaymentAllocationDraft
132
{
133
return
new
PaymentAllocationDraftModel
(
134
$this->
id
,
135
$this->paymentMethod instanceof
PaymentMethodReferenceBuilder
? $this->paymentMethod->
build
() : $this->paymentMethod,
136
$this->allocation instanceof
AllocationDraftBuilder
? $this->allocation->
build
() : $this->allocation
137
);
138
}
139
140
public
static
function
of
():
PaymentAllocationDraftBuilder
141
{
142
return
new
self
();
143
}
144
}
Commercetools\Api\Models\Cart\AllocationDraftBuilder
Definition
AllocationDraftBuilder.php:22
Commercetools\Api\Models\Cart\AllocationDraftBuilder\build
build()
Definition
AllocationDraftBuilder.php:23
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder
Definition
PaymentAllocationDraftBuilder.php:24
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\build
build()
Definition
PaymentAllocationDraftBuilder.php:131
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\withPaymentMethodBuilder
withPaymentMethodBuilder(?PaymentMethodReferenceBuilder $paymentMethod)
Definition
PaymentAllocationDraftBuilder.php:113
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\withAllocation
withAllocation(?AllocationDraft $allocation)
Definition
PaymentAllocationDraftBuilder.php:102
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\getAllocation
getAllocation()
Definition
PaymentAllocationDraftBuilder.php:71
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\withId
withId(?string $id)
Definition
PaymentAllocationDraftBuilder.php:80
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\withPaymentMethod
withPaymentMethod(?PaymentMethodReference $paymentMethod)
Definition
PaymentAllocationDraftBuilder.php:91
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\getId
getId()
Definition
PaymentAllocationDraftBuilder.php:49
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\getPaymentMethod
getPaymentMethod()
Definition
PaymentAllocationDraftBuilder.php:60
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\of
static of()
Definition
PaymentAllocationDraftBuilder.php:140
Commercetools\Api\Models\Cart\PaymentAllocationDraftBuilder\withAllocationBuilder
withAllocationBuilder(?AllocationDraftBuilder $allocation)
Definition
PaymentAllocationDraftBuilder.php:124
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel
Definition
PaymentAllocationDraftModel.php:23
Commercetools\Api\Models\PaymentMethod\PaymentMethodReferenceBuilder
Definition
PaymentMethodReferenceBuilder.php:24
Commercetools\Api\Models\PaymentMethod\PaymentMethodReferenceBuilder\build
build()
Definition
PaymentMethodReferenceBuilder.php:92
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Cart\AllocationDraft
Definition
AllocationDraft.php:15
Commercetools\Api\Models\Cart\PaymentAllocationDraft
Definition
PaymentAllocationDraft.php:16
Commercetools\Api\Models\PaymentMethod\PaymentMethodReference
Definition
PaymentMethodReference.php:16
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition
AbsoluteAllocation.php:9
Generated by
1.9.8