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
HighPrecisionMoneyDraftModel.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
HighPrecisionMoneyDraftModel
extends
JsonObjectModel
implements
HighPrecisionMoneyDraft
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'highPrecision'
;
27
protected
$centAmount
;
28
33
protected
$currencyCode
;
34
39
protected
$type
;
40
45
protected
$fractionDigits
;
46
51
protected
$preciseAmount
;
52
53
57
public
function
__construct
(
58
?
int
$centAmount
=
null
,
59
?
string
$currencyCode
=
null
,
60
?
int
$fractionDigits
=
null
,
61
?
int
$preciseAmount
=
null
,
62
?
string
$type
=
null
63
) {
64
$this->centAmount =
$centAmount
;
65
$this->currencyCode =
$currencyCode
;
66
$this->fractionDigits =
$fractionDigits
;
67
$this->preciseAmount =
$preciseAmount
;
68
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
69
}
70
79
public
function
getCentAmount
()
80
{
81
if
(is_null($this->centAmount)) {
83
$data = $this->
raw
(self::FIELD_CENT_AMOUNT);
84
if
(is_null($data)) {
85
return
null
;
86
}
87
$this->centAmount = (int) $data;
88
}
89
90
return
$this->centAmount
;
91
}
92
99
public
function
getCurrencyCode
()
100
{
101
if
(is_null($this->currencyCode)) {
103
$data = $this->
raw
(self::FIELD_CURRENCY_CODE);
104
if
(is_null($data)) {
105
return
null
;
106
}
107
$this->currencyCode = (string) $data;
108
}
109
110
return
$this->currencyCode
;
111
}
112
119
public
function
getType
()
120
{
121
if
(is_null($this->type)) {
123
$data = $this->
raw
(self::FIELD_TYPE);
124
if
(is_null($data)) {
125
return
null
;
126
}
127
$this->type = (string) $data;
128
}
129
130
return
$this->type
;
131
}
132
139
public
function
getFractionDigits
()
140
{
141
if
(is_null($this->fractionDigits)) {
143
$data = $this->
raw
(self::FIELD_FRACTION_DIGITS);
144
if
(is_null($data)) {
145
return
null
;
146
}
147
$this->fractionDigits = (int) $data;
148
}
149
150
return
$this->fractionDigits
;
151
}
152
159
public
function
getPreciseAmount
()
160
{
161
if
(is_null($this->preciseAmount)) {
163
$data = $this->
raw
(self::FIELD_PRECISE_AMOUNT);
164
if
(is_null($data)) {
165
return
null
;
166
}
167
$this->preciseAmount = (int) $data;
168
}
169
170
return
$this->preciseAmount
;
171
}
172
173
177
public
function
setCentAmount
(?
int
$centAmount
): void
178
{
179
$this->centAmount =
$centAmount
;
180
}
181
185
public
function
setCurrencyCode
(?
string
$currencyCode
): void
186
{
187
$this->currencyCode =
$currencyCode
;
188
}
189
193
public
function
setFractionDigits
(?
int
$fractionDigits
): void
194
{
195
$this->fractionDigits =
$fractionDigits
;
196
}
197
201
public
function
setPreciseAmount
(?
int
$preciseAmount
): void
202
{
203
$this->preciseAmount =
$preciseAmount
;
204
}
205
}
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel
Definition
HighPrecisionMoneyDraftModel.php:21
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\getFractionDigits
getFractionDigits()
Definition
HighPrecisionMoneyDraftModel.php:139
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\getCurrencyCode
getCurrencyCode()
Definition
HighPrecisionMoneyDraftModel.php:99
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\$preciseAmount
$preciseAmount
Definition
HighPrecisionMoneyDraftModel.php:51
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\$fractionDigits
$fractionDigits
Definition
HighPrecisionMoneyDraftModel.php:45
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\$type
$type
Definition
HighPrecisionMoneyDraftModel.php:39
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\getCentAmount
getCentAmount()
Definition
HighPrecisionMoneyDraftModel.php:79
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\setCentAmount
setCentAmount(?int $centAmount)
Definition
HighPrecisionMoneyDraftModel.php:177
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
HighPrecisionMoneyDraftModel.php:22
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\getPreciseAmount
getPreciseAmount()
Definition
HighPrecisionMoneyDraftModel.php:159
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\getType
getType()
Definition
HighPrecisionMoneyDraftModel.php:119
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\setPreciseAmount
setPreciseAmount(?int $preciseAmount)
Definition
HighPrecisionMoneyDraftModel.php:201
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\$centAmount
$centAmount
Definition
HighPrecisionMoneyDraftModel.php:27
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\__construct
__construct(?int $centAmount=null, ?string $currencyCode=null, ?int $fractionDigits=null, ?int $preciseAmount=null, ?string $type=null)
Definition
HighPrecisionMoneyDraftModel.php:57
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\setCurrencyCode
setCurrencyCode(?string $currencyCode)
Definition
HighPrecisionMoneyDraftModel.php:185
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\setFractionDigits
setFractionDigits(?int $fractionDigits)
Definition
HighPrecisionMoneyDraftModel.php:193
Commercetools\Api\Models\Common\HighPrecisionMoneyDraftModel\$currencyCode
$currencyCode
Definition
HighPrecisionMoneyDraftModel.php:33
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\HighPrecisionMoneyDraft
Definition
HighPrecisionMoneyDraft.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Common
Definition
Address.php:9
Generated by
1.9.8