commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
Label
PaymentLabelModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Label
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
use
Commercetools\History\Models\Common\Money
;
17
use
Commercetools\History\Models\Common\MoneyModel
;
18
22
final
class
PaymentLabelModel
extends
JsonObjectModel
implements
PaymentLabel
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'PaymentLabel'
;
30
protected
$type
;
31
36
protected
$key
;
37
42
protected
$amountPlanned
;
43
44
48
public
function
__construct
(
49
?
string
$key
=
null
,
50
?
Money
$amountPlanned
=
null
,
51
?
string
$type
=
null
52
) {
53
$this->key =
$key
;
54
$this->amountPlanned =
$amountPlanned
;
55
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
56
}
57
62
public
function
getType
()
63
{
64
if
(is_null($this->type)) {
66
$data = $this->
raw
(self::FIELD_TYPE);
67
if
(is_null($data)) {
68
return
null
;
69
}
70
$this->type = (string) $data;
71
}
72
73
return
$this->type
;
74
}
75
82
public
function
getKey
()
83
{
84
if
(is_null($this->key)) {
86
$data = $this->
raw
(self::FIELD_KEY);
87
if
(is_null($data)) {
88
return
null
;
89
}
90
$this->key = (string) $data;
91
}
92
93
return
$this->key
;
94
}
95
102
public
function
getAmountPlanned
()
103
{
104
if
(is_null($this->amountPlanned)) {
106
$data = $this->
raw
(self::FIELD_AMOUNT_PLANNED);
107
if
(is_null($data)) {
108
return
null
;
109
}
110
111
$this->amountPlanned =
MoneyModel::of
($data);
112
}
113
114
return
$this->amountPlanned
;
115
}
116
117
121
public
function
setKey
(?
string
$key
): void
122
{
123
$this->key =
$key
;
124
}
125
129
public
function
setAmountPlanned
(?
Money
$amountPlanned
): void
130
{
131
$this->amountPlanned =
$amountPlanned
;
132
}
133
134
135
136
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\BaseJsonObject\of
static of($data=null)
Definition:
BaseJsonObject.php:26
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\History\Models\Common\MoneyModel
Definition:
MoneyModel.php:21
Commercetools\History\Models\Label\PaymentLabelModel
Definition:
PaymentLabelModel.php:23
Commercetools\History\Models\Label\PaymentLabelModel\setAmountPlanned
setAmountPlanned(?Money $amountPlanned)
Definition:
PaymentLabelModel.php:129
Commercetools\History\Models\Label\PaymentLabelModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
PaymentLabelModel.php:25
Commercetools\History\Models\Label\PaymentLabelModel\setKey
setKey(?string $key)
Definition:
PaymentLabelModel.php:121
Commercetools\History\Models\Label\PaymentLabelModel\$key
$key
Definition:
PaymentLabelModel.php:36
Commercetools\History\Models\Label\PaymentLabelModel\$type
$type
Definition:
PaymentLabelModel.php:30
Commercetools\History\Models\Label\PaymentLabelModel\__construct
__construct(?string $key=null, ?Money $amountPlanned=null, ?string $type=null)
Definition:
PaymentLabelModel.php:48
Commercetools\History\Models\Label\PaymentLabelModel\getAmountPlanned
getAmountPlanned()
Definition:
PaymentLabelModel.php:102
Commercetools\History\Models\Label\PaymentLabelModel\getKey
getKey()
Definition:
PaymentLabelModel.php:82
Commercetools\History\Models\Label\PaymentLabelModel\$amountPlanned
$amountPlanned
Definition:
PaymentLabelModel.php:42
Commercetools\History\Models\Label\PaymentLabelModel\getType
getType()
Definition:
PaymentLabelModel.php:62
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\Common\Money
Definition:
Money.php:15
Commercetools\History\Models\Label\PaymentLabel
Definition:
PaymentLabel.php:16
Commercetools\History\Models\Label
Definition:
AssociateRoleLabel.php:9
Generated by
1.9.1