commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CentPrecisionMoneyBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class CentPrecisionMoneyBuilder implements Builder
22{
27 private $centAmount;
28
33 private $currencyCode;
34
39 private $fractionDigits;
40
51 public function getCentAmount()
52 {
53 return $this->centAmount;
54 }
55
62 public function getCurrencyCode()
63 {
64 return $this->currencyCode;
65 }
66
73 public function getFractionDigits()
74 {
75 return $this->fractionDigits;
76 }
77
82 public function withCentAmount(?int $centAmount)
83 {
84 $this->centAmount = $centAmount;
85
86 return $this;
87 }
88
93 public function withCurrencyCode(?string $currencyCode)
94 {
95 $this->currencyCode = $currencyCode;
96
97 return $this;
98 }
99
104 public function withFractionDigits(?int $fractionDigits)
105 {
106 $this->fractionDigits = $fractionDigits;
107
108 return $this;
109 }
110
111
112 public function build(): CentPrecisionMoney
113 {
114 return new CentPrecisionMoneyModel(
115 $this->centAmount,
116 $this->currencyCode,
117 $this->fractionDigits
118 );
119 }
120
121 public static function of(): CentPrecisionMoneyBuilder
122 {
123 return new self();
124 }
125}