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