commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Product
RangeFacetResultModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Product
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
15
use stdClass;
16
20
final
class
RangeFacetResultModel
extends
JsonObjectModel
implements
RangeFacetResult
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'range'
;
27
protected
$type
;
28
33
protected
$ranges
;
34
35
39
public
function
__construct
(
40
?
FacetRangeCollection
$ranges
=
null
,
41
?
string
$type
=
null
42
) {
43
$this->ranges =
$ranges
;
44
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
45
}
46
51
public
function
getType
()
52
{
53
if
(is_null($this->type)) {
55
$data = $this->
raw
(self::FIELD_TYPE);
56
if
(is_null($data)) {
57
return
null
;
58
}
59
$this->type = (string) $data;
60
}
61
62
return
$this->type
;
63
}
64
69
public
function
getRanges
()
70
{
71
if
(is_null($this->ranges)) {
73
$data = $this->
raw
(self::FIELD_RANGES);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->ranges =
FacetRangeCollection::fromArray
($data);
78
}
79
80
return
$this->ranges
;
81
}
82
83
87
public
function
setRanges
(?
FacetRangeCollection
$ranges
): void
88
{
89
$this->ranges =
$ranges
;
90
}
91
}
Commercetools\Api\Models\Product\FacetRangeCollection
Definition:
FacetRangeCollection.php:22
Commercetools\Api\Models\Product\RangeFacetResultModel
Definition:
RangeFacetResultModel.php:21
Commercetools\Api\Models\Product\RangeFacetResultModel\$type
$type
Definition:
RangeFacetResultModel.php:27
Commercetools\Api\Models\Product\RangeFacetResultModel\getType
getType()
Definition:
RangeFacetResultModel.php:51
Commercetools\Api\Models\Product\RangeFacetResultModel\$ranges
$ranges
Definition:
RangeFacetResultModel.php:33
Commercetools\Api\Models\Product\RangeFacetResultModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition:
RangeFacetResultModel.php:22
Commercetools\Api\Models\Product\RangeFacetResultModel\__construct
__construct(?FacetRangeCollection $ranges=null, ?string $type=null)
Definition:
RangeFacetResultModel.php:39
Commercetools\Api\Models\Product\RangeFacetResultModel\setRanges
setRanges(?FacetRangeCollection $ranges)
Definition:
RangeFacetResultModel.php:87
Commercetools\Api\Models\Product\RangeFacetResultModel\getRanges
getRanges()
Definition:
RangeFacetResultModel.php:69
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Base\MapperSequence\fromArray
static fromArray(array $data)
Definition:
MapperSequence.php:56
Commercetools\Api\Models\Product\RangeFacetResult
Definition:
RangeFacetResult.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Product
Definition:
AttributeAccessor.php:4
Generated by
1.9.1