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
PaymentAllocationDraftModel.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\PaymentMethodReferenceModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
PaymentAllocationDraftModel
extends
JsonObjectModel
implements
PaymentAllocationDraft
23
{
28
protected
$id
;
29
34
protected
$paymentMethod
;
35
40
protected
$allocation
;
41
42
46
public
function
__construct
(
47
?
string
$id
=
null
,
48
?
PaymentMethodReference
$paymentMethod
=
null
,
49
?
AllocationDraft
$allocation
=
null
50
) {
51
$this->
id
=
$id
;
52
$this->paymentMethod =
$paymentMethod
;
53
$this->allocation =
$allocation
;
54
}
55
62
public
function
getId
()
63
{
64
if
(is_null($this->
id
)) {
66
$data = $this->
raw
(self::FIELD_ID);
67
if
(is_null($data)) {
68
return
null
;
69
}
70
$this->
id
= (string) $data;
71
}
72
73
return
$this->id
;
74
}
75
82
public
function
getPaymentMethod
()
83
{
84
if
(is_null($this->paymentMethod)) {
86
$data = $this->
raw
(self::FIELD_PAYMENT_METHOD);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
91
$this->paymentMethod = PaymentMethodReferenceModel::of($data);
92
}
93
94
return
$this->paymentMethod
;
95
}
96
103
public
function
getAllocation
()
104
{
105
if
(is_null($this->allocation)) {
107
$data = $this->
raw
(self::FIELD_ALLOCATION);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$className =
AllocationDraftModel::resolveDiscriminatorClass
($data);
112
$this->allocation = $className::of($data);
113
}
114
115
return
$this->allocation
;
116
}
117
118
122
public
function
setId
(?
string
$id
): void
123
{
124
$this->
id
=
$id
;
125
}
126
130
public
function
setPaymentMethod
(?
PaymentMethodReference
$paymentMethod
): void
131
{
132
$this->paymentMethod =
$paymentMethod
;
133
}
134
138
public
function
setAllocation
(?
AllocationDraft
$allocation
): void
139
{
140
$this->allocation =
$allocation
;
141
}
142
}
Commercetools\Api\Models\Cart\AllocationDraftModel\resolveDiscriminatorClass
static resolveDiscriminatorClass($value)
Definition
AllocationDraftModel.php:75
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel
Definition
PaymentAllocationDraftModel.php:23
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\$allocation
$allocation
Definition
PaymentAllocationDraftModel.php:40
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\setId
setId(?string $id)
Definition
PaymentAllocationDraftModel.php:122
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\$id
$id
Definition
PaymentAllocationDraftModel.php:28
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\getId
getId()
Definition
PaymentAllocationDraftModel.php:62
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\setPaymentMethod
setPaymentMethod(?PaymentMethodReference $paymentMethod)
Definition
PaymentAllocationDraftModel.php:130
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\getPaymentMethod
getPaymentMethod()
Definition
PaymentAllocationDraftModel.php:82
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\__construct
__construct(?string $id=null, ?PaymentMethodReference $paymentMethod=null, ?AllocationDraft $allocation=null)
Definition
PaymentAllocationDraftModel.php:46
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\getAllocation
getAllocation()
Definition
PaymentAllocationDraftModel.php:103
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\$paymentMethod
$paymentMethod
Definition
PaymentAllocationDraftModel.php:34
Commercetools\Api\Models\Cart\PaymentAllocationDraftModel\setAllocation
setAllocation(?AllocationDraft $allocation)
Definition
PaymentAllocationDraftModel.php:138
Commercetools\Api\Models\PaymentMethod\PaymentMethodReferenceModel
Definition
PaymentMethodReferenceModel.php:23
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition
BaseJsonObject.php:57
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\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Cart
Definition
AbsoluteAllocation.php:9
Generated by
1.9.8