commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
HighPrecisionMoneyDraftModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
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
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
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}
__construct(?int $centAmount=null, ?string $currencyCode=null, ?int $fractionDigits=null, ?int $preciseAmount=null, ?string $type=null)