commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
FacetRangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
20final class FacetRangeModel extends JsonObjectModel implements FacetRange
21{
26 protected $from;
27
32 protected $fromStr;
33
38 protected $to;
39
44 protected $toStr;
45
50 protected $count;
51
56 protected $productCount;
57
62 protected $total;
63
68 protected $min;
69
74 protected $max;
75
80 protected $mean;
81
82
86 public function __construct(
87 ?float $from = null,
88 ?string $fromStr = null,
89 ?float $to = null,
90 ?string $toStr = null,
91 ?int $count = null,
92 ?int $productCount = null,
93 ?float $total = null,
94 ?float $min = null,
95 ?float $max = null,
96 ?float $mean = null
97 ) {
98 $this->from = $from;
99 $this->fromStr = $fromStr;
100 $this->to = $to;
101 $this->toStr = $toStr;
102 $this->count = $count;
103 $this->productCount = $productCount;
104 $this->total = $total;
105 $this->min = $min;
106 $this->max = $max;
107 $this->mean = $mean;
108 }
109
114 public function getFrom()
115 {
116 if (is_null($this->from)) {
118 $data = $this->raw(self::FIELD_FROM);
119 if (is_null($data)) {
120 return null;
121 }
122 $this->from = (float) $data;
123 }
124
125 return $this->from;
126 }
127
132 public function getFromStr()
133 {
134 if (is_null($this->fromStr)) {
136 $data = $this->raw(self::FIELD_FROM_STR);
137 if (is_null($data)) {
138 return null;
139 }
140 $this->fromStr = (string) $data;
141 }
142
143 return $this->fromStr;
144 }
145
150 public function getTo()
151 {
152 if (is_null($this->to)) {
154 $data = $this->raw(self::FIELD_TO);
155 if (is_null($data)) {
156 return null;
157 }
158 $this->to = (float) $data;
159 }
160
161 return $this->to;
162 }
163
168 public function getToStr()
169 {
170 if (is_null($this->toStr)) {
172 $data = $this->raw(self::FIELD_TO_STR);
173 if (is_null($data)) {
174 return null;
175 }
176 $this->toStr = (string) $data;
177 }
178
179 return $this->toStr;
180 }
181
186 public function getCount()
187 {
188 if (is_null($this->count)) {
190 $data = $this->raw(self::FIELD_COUNT);
191 if (is_null($data)) {
192 return null;
193 }
194 $this->count = (int) $data;
195 }
196
197 return $this->count;
198 }
199
204 public function getProductCount()
205 {
206 if (is_null($this->productCount)) {
208 $data = $this->raw(self::FIELD_PRODUCT_COUNT);
209 if (is_null($data)) {
210 return null;
211 }
212 $this->productCount = (int) $data;
213 }
214
215 return $this->productCount;
216 }
217
222 public function getTotal()
223 {
224 if (is_null($this->total)) {
226 $data = $this->raw(self::FIELD_TOTAL);
227 if (is_null($data)) {
228 return null;
229 }
230 $this->total = (float) $data;
231 }
232
233 return $this->total;
234 }
235
240 public function getMin()
241 {
242 if (is_null($this->min)) {
244 $data = $this->raw(self::FIELD_MIN);
245 if (is_null($data)) {
246 return null;
247 }
248 $this->min = (float) $data;
249 }
250
251 return $this->min;
252 }
253
258 public function getMax()
259 {
260 if (is_null($this->max)) {
262 $data = $this->raw(self::FIELD_MAX);
263 if (is_null($data)) {
264 return null;
265 }
266 $this->max = (float) $data;
267 }
268
269 return $this->max;
270 }
271
276 public function getMean()
277 {
278 if (is_null($this->mean)) {
280 $data = $this->raw(self::FIELD_MEAN);
281 if (is_null($data)) {
282 return null;
283 }
284 $this->mean = (float) $data;
285 }
286
287 return $this->mean;
288 }
289
290
294 public function setFrom(?float $from): void
295 {
296 $this->from = $from;
297 }
298
302 public function setFromStr(?string $fromStr): void
303 {
304 $this->fromStr = $fromStr;
305 }
306
310 public function setTo(?float $to): void
311 {
312 $this->to = $to;
313 }
314
318 public function setToStr(?string $toStr): void
319 {
320 $this->toStr = $toStr;
321 }
322
326 public function setCount(?int $count): void
327 {
328 $this->count = $count;
329 }
330
334 public function setProductCount(?int $productCount): void
335 {
336 $this->productCount = $productCount;
337 }
338
342 public function setTotal(?float $total): void
343 {
344 $this->total = $total;
345 }
346
350 public function setMin(?float $min): void
351 {
352 $this->min = $min;
353 }
354
358 public function setMax(?float $max): void
359 {
360 $this->max = $max;
361 }
362
366 public function setMean(?float $mean): void
367 {
368 $this->mean = $mean;
369 }
370}
__construct(?float $from=null, ?string $fromStr=null, ?float $to=null, ?string $toStr=null, ?int $count=null, ?int $productCount=null, ?float $total=null, ?float $min=null, ?float $max=null, ?float $mean=null)