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
80 public function getCentAmount()
81 {
82 if (is_null($this->centAmount)) {
84 $data = $this->raw(self::FIELD_CENT_AMOUNT);
85 if (is_null($data)) {
86 return null;
87 }
88 $this->centAmount = (int) $data;
89 }
90
91 return $this->centAmount;
92 }
93
100 public function getCurrencyCode()
101 {
102 if (is_null($this->currencyCode)) {
104 $data = $this->raw(self::FIELD_CURRENCY_CODE);
105 if (is_null($data)) {
106 return null;
107 }
108 $this->currencyCode = (string) $data;
109 }
110
111 return $this->currencyCode;
112 }
113
120 public function getType()
121 {
122 if (is_null($this->type)) {
124 $data = $this->raw(self::FIELD_TYPE);
125 if (is_null($data)) {
126 return null;
127 }
128 $this->type = (string) $data;
129 }
130
131 return $this->type;
132 }
133
140 public function getFractionDigits()
141 {
142 if (is_null($this->fractionDigits)) {
144 $data = $this->raw(self::FIELD_FRACTION_DIGITS);
145 if (is_null($data)) {
146 return null;
147 }
148 $this->fractionDigits = (int) $data;
149 }
150
152 }
153
161 public function getPreciseAmount()
162 {
163 if (is_null($this->preciseAmount)) {
165 $data = $this->raw(self::FIELD_PRECISE_AMOUNT);
166 if (is_null($data)) {
167 return null;
168 }
169 $this->preciseAmount = (int) $data;
170 }
171
173 }
174
175
179 public function setCentAmount(?int $centAmount): void
180 {
181 $this->centAmount = $centAmount;
182 }
183
187 public function setCurrencyCode(?string $currencyCode): void
188 {
189 $this->currencyCode = $currencyCode;
190 }
191
195 public function setFractionDigits(?int $fractionDigits): void
196 {
197 $this->fractionDigits = $fractionDigits;
198 }
199
203 public function setPreciseAmount(?int $preciseAmount): void
204 {
205 $this->preciseAmount = $preciseAmount;
206 }
207}
__construct(?int $centAmount=null, ?string $currencyCode=null, ?int $fractionDigits=null, ?int $preciseAmount=null, ?string $type=null)