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
CentPrecisionMoneyModel.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
CentPrecisionMoneyModel
extends
JsonObjectModel
implements
CentPrecisionMoney
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
73
public
function
getCentAmount
()
74
{
75
if
(is_null($this->centAmount)) {
77
$data = $this->
raw
(self::FIELD_CENT_AMOUNT);
78
if
(is_null($data)) {
79
return
null
;
80
}
81
$this->centAmount = (int) $data;
82
}
83
84
return
$this->centAmount
;
85
}
86
93
public
function
getCurrencyCode
()
94
{
95
if
(is_null($this->currencyCode)) {
97
$data = $this->
raw
(self::FIELD_CURRENCY_CODE);
98
if
(is_null($data)) {
99
return
null
;
100
}
101
$this->currencyCode = (string) $data;
102
}
103
104
return
$this->currencyCode
;
105
}
106
113
public
function
getType
()
114
{
115
if
(is_null($this->type)) {
117
$data = $this->
raw
(self::FIELD_TYPE);
118
if
(is_null($data)) {
119
return
null
;
120
}
121
$this->type = (string) $data;
122
}
123
124
return
$this->type
;
125
}
126
133
public
function
getFractionDigits
()
134
{
135
if
(is_null($this->fractionDigits)) {
137
$data = $this->
raw
(self::FIELD_FRACTION_DIGITS);
138
if
(is_null($data)) {
139
return
null
;
140
}
141
$this->fractionDigits = (int) $data;
142
}
143
144
return
$this->fractionDigits
;
145
}
146
147
151
public
function
setCentAmount
(?
int
$centAmount
): void
152
{
153
$this->centAmount =
$centAmount
;
154
}
155
159
public
function
setCurrencyCode
(?
string
$currencyCode
): void
160
{
161
$this->currencyCode =
$currencyCode
;
162
}
163
167
public
function
setFractionDigits
(?
int
$fractionDigits
): void
168
{
169
$this->fractionDigits =
$fractionDigits
;
170
}
171
}
Commercetools\Api\Models\Common\CentPrecisionMoneyModel
Definition
CentPrecisionMoneyModel.php:21
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\getType
getType()
Definition
CentPrecisionMoneyModel.php:113
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\$currencyCode
$currencyCode
Definition
CentPrecisionMoneyModel.php:33
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
CentPrecisionMoneyModel.php:22
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\getCentAmount
getCentAmount()
Definition
CentPrecisionMoneyModel.php:73
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\setFractionDigits
setFractionDigits(?int $fractionDigits)
Definition
CentPrecisionMoneyModel.php:167
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\getFractionDigits
getFractionDigits()
Definition
CentPrecisionMoneyModel.php:133
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\__construct
__construct(?int $centAmount=null, ?string $currencyCode=null, ?int $fractionDigits=null, ?string $type=null)
Definition
CentPrecisionMoneyModel.php:51
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\setCentAmount
setCentAmount(?int $centAmount)
Definition
CentPrecisionMoneyModel.php:151
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\getCurrencyCode
getCurrencyCode()
Definition
CentPrecisionMoneyModel.php:93
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\$fractionDigits
$fractionDigits
Definition
CentPrecisionMoneyModel.php:45
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\$centAmount
$centAmount
Definition
CentPrecisionMoneyModel.php:27
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\setCurrencyCode
setCurrencyCode(?string $currencyCode)
Definition
CentPrecisionMoneyModel.php:159
Commercetools\Api\Models\Common\CentPrecisionMoneyModel\$type
$type
Definition
CentPrecisionMoneyModel.php:39
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\CentPrecisionMoney
Definition
CentPrecisionMoney.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Common
Definition
Address.php:9
Generated by
1.9.8