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
Common
CentPrecisionMoneyDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Common
;
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
20
final
class
CentPrecisionMoneyDraftModel
extends
JsonObjectModel
implements
CentPrecisionMoneyDraft
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'centPrecision'
;
27
protected
$centAmount
;
28
33
protected
$currencyCode
;
34
39
protected
$type
;
40
45
protected
$fractionDigits
;
46
47
51
public
function
__construct
(
52
?
int
$centAmount
=
null
,
53
?
string
$currencyCode
=
null
,
54
?
int
$fractionDigits
=
null
,
55
?
string
$type
=
null
56
) {
57
$this->centAmount =
$centAmount
;
58
$this->currencyCode =
$currencyCode
;
59
$this->fractionDigits =
$fractionDigits
;
60
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
61
}
62
69
public
function
getCentAmount
()
70
{
71
if
(is_null($this->centAmount)) {
73
$data = $this->
raw
(self::FIELD_CENT_AMOUNT);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->centAmount = (int) $data;
78
}
79
80
return
$this->centAmount
;
81
}
82
89
public
function
getCurrencyCode
()
90
{
91
if
(is_null($this->currencyCode)) {
93
$data = $this->
raw
(self::FIELD_CURRENCY_CODE);
94
if
(is_null($data)) {
95
return
null
;
96
}
97
$this->currencyCode = (string) $data;
98
}
99
100
return
$this->currencyCode
;
101
}
102
109
public
function
getType
()
110
{
111
if
(is_null($this->type)) {
113
$data = $this->
raw
(self::FIELD_TYPE);
114
if
(is_null($data)) {
115
return
null
;
116
}
117
$this->type = (string) $data;
118
}
119
120
return
$this->type
;
121
}
122
129
public
function
getFractionDigits
()
130
{
131
if
(is_null($this->fractionDigits)) {
133
$data = $this->
raw
(self::FIELD_FRACTION_DIGITS);
134
if
(is_null($data)) {
135
return
null
;
136
}
137
$this->fractionDigits = (int) $data;
138
}
139
140
return
$this->fractionDigits
;
141
}
142
143
147
public
function
setCentAmount
(?
int
$centAmount
): void
148
{
149
$this->centAmount =
$centAmount
;
150
}
151
155
public
function
setCurrencyCode
(?
string
$currencyCode
): void
156
{
157
$this->currencyCode =
$currencyCode
;
158
}
159
163
public
function
setFractionDigits
(?
int
$fractionDigits
): void
164
{
165
$this->fractionDigits =
$fractionDigits
;
166
}
167
}
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel
Definition
CentPrecisionMoneyDraftModel.php:21
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\getFractionDigits
getFractionDigits()
Definition
CentPrecisionMoneyDraftModel.php:129
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
CentPrecisionMoneyDraftModel.php:22
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\setCurrencyCode
setCurrencyCode(?string $currencyCode)
Definition
CentPrecisionMoneyDraftModel.php:155
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\setFractionDigits
setFractionDigits(?int $fractionDigits)
Definition
CentPrecisionMoneyDraftModel.php:163
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\$centAmount
$centAmount
Definition
CentPrecisionMoneyDraftModel.php:27
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\$currencyCode
$currencyCode
Definition
CentPrecisionMoneyDraftModel.php:33
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\getCurrencyCode
getCurrencyCode()
Definition
CentPrecisionMoneyDraftModel.php:89
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\__construct
__construct(?int $centAmount=null, ?string $currencyCode=null, ?int $fractionDigits=null, ?string $type=null)
Definition
CentPrecisionMoneyDraftModel.php:51
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\getCentAmount
getCentAmount()
Definition
CentPrecisionMoneyDraftModel.php:69
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\$fractionDigits
$fractionDigits
Definition
CentPrecisionMoneyDraftModel.php:45
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\$type
$type
Definition
CentPrecisionMoneyDraftModel.php:39
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\setCentAmount
setCentAmount(?int $centAmount)
Definition
CentPrecisionMoneyDraftModel.php:147
Commercetools\Api\Models\Common\CentPrecisionMoneyDraftModel\getType
getType()
Definition
CentPrecisionMoneyDraftModel.php:109
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\Common\CentPrecisionMoneyDraft
Definition
CentPrecisionMoneyDraft.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Common
Definition
Address.php:9
Generated by
1.9.8