commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AddPriceChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'AddPriceChange';
30 protected $type;
31
36 protected $change;
37
42 protected $nextValue;
43
48 protected $catalogData;
49
54 protected $priceId;
55
56
60 public function __construct(
61 ?string $change = null,
62 ?Price $nextValue = null,
63 ?string $catalogData = null,
64 ?string $priceId = null,
65 ?string $type = null
66 ) {
67 $this->change = $change;
68 $this->nextValue = $nextValue;
69 $this->catalogData = $catalogData;
70 $this->priceId = $priceId;
71 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
72 }
73
78 public function getType()
79 {
80 if (is_null($this->type)) {
82 $data = $this->raw(self::FIELD_TYPE);
83 if (is_null($data)) {
84 return null;
85 }
86 $this->type = (string) $data;
87 }
88
89 return $this->type;
90 }
91
96 public function getChange()
97 {
98 if (is_null($this->change)) {
100 $data = $this->raw(self::FIELD_CHANGE);
101 if (is_null($data)) {
102 return null;
103 }
104 $this->change = (string) $data;
105 }
106
107 return $this->change;
108 }
109
116 public function getNextValue()
117 {
118 if (is_null($this->nextValue)) {
120 $data = $this->raw(self::FIELD_NEXT_VALUE);
121 if (is_null($data)) {
122 return null;
123 }
124
125 $this->nextValue = PriceModel::of($data);
126 }
127
128 return $this->nextValue;
129 }
130
140 public function getCatalogData()
141 {
142 if (is_null($this->catalogData)) {
144 $data = $this->raw(self::FIELD_CATALOG_DATA);
145 if (is_null($data)) {
146 return null;
147 }
148 $this->catalogData = (string) $data;
149 }
150
151 return $this->catalogData;
152 }
153
160 public function getPriceId()
161 {
162 if (is_null($this->priceId)) {
164 $data = $this->raw(self::FIELD_PRICE_ID);
165 if (is_null($data)) {
166 return null;
167 }
168 $this->priceId = (string) $data;
169 }
170
171 return $this->priceId;
172 }
173
174
178 public function setChange(?string $change): void
179 {
180 $this->change = $change;
181 }
182
186 public function setNextValue(?Price $nextValue): void
187 {
188 $this->nextValue = $nextValue;
189 }
190
194 public function setCatalogData(?string $catalogData): void
195 {
196 $this->catalogData = $catalogData;
197 }
198
202 public function setPriceId(?string $priceId): void
203 {
204 $this->priceId = $priceId;
205 }
206
207
208
209}
__construct(?string $change=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $priceId=null, ?string $type=null)