commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
PaymentLabelModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
22final class PaymentLabelModel extends JsonObjectModel implements PaymentLabel
23{
24
25 public const DISCRIMINATOR_VALUE = 'PaymentLabel';
30 protected $type;
31
36 protected $key;
37
42 protected $amountPlanned;
43
44
48 public function __construct(
49 ?string $key = null,
50 ?Money $amountPlanned = null,
51 ?string $type = null
52 ) {
53 $this->key = $key;
54 $this->amountPlanned = $amountPlanned;
55 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
56 }
57
62 public function getType()
63 {
64 if (is_null($this->type)) {
66 $data = $this->raw(self::FIELD_TYPE);
67 if (is_null($data)) {
68 return null;
69 }
70 $this->type = (string) $data;
71 }
72
73 return $this->type;
74 }
75
82 public function getKey()
83 {
84 if (is_null($this->key)) {
86 $data = $this->raw(self::FIELD_KEY);
87 if (is_null($data)) {
88 return null;
89 }
90 $this->key = (string) $data;
91 }
92
93 return $this->key;
94 }
95
102 public function getAmountPlanned()
103 {
104 if (is_null($this->amountPlanned)) {
106 $data = $this->raw(self::FIELD_AMOUNT_PLANNED);
107 if (is_null($data)) {
108 return null;
109 }
110
111 $this->amountPlanned = MoneyModel::of($data);
112 }
113
115 }
116
117
121 public function setKey(?string $key): void
122 {
123 $this->key = $key;
124 }
125
129 public function setAmountPlanned(?Money $amountPlanned): void
130 {
131 $this->amountPlanned = $amountPlanned;
132 }
133
134
135
136}
__construct(?string $key=null, ?Money $amountPlanned=null, ?string $type=null)