commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
Product
TermFacetResultModel.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
TermFacetResultModel
extends
JsonObjectModel
implements
TermFacetResult
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'terms'
;
27
protected
$type
;
28
33
protected
$dataType
;
34
39
protected
$missing
;
40
45
protected
$total
;
46
51
protected
$other
;
52
57
protected
$terms
;
58
59
63
public
function
__construct
(
64
?
string
$dataType
=
null
,
65
?
int
$missing
=
null
,
66
?
int
$total
=
null
,
67
?
int
$other
=
null
,
68
?
FacetTermCollection
$terms
=
null
,
69
?
string
$type
=
null
70
) {
71
$this->dataType =
$dataType
;
72
$this->missing =
$missing
;
73
$this->total =
$total
;
74
$this->other =
$other
;
75
$this->terms =
$terms
;
76
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
77
}
78
83
public
function
getType
()
84
{
85
if
(is_null($this->type)) {
87
$data = $this->
raw
(self::FIELD_TYPE);
88
if
(is_null($data)) {
89
return
null
;
90
}
91
$this->type = (string) $data;
92
}
93
94
return
$this->type
;
95
}
96
101
public
function
getDataType
()
102
{
103
if
(is_null($this->dataType)) {
105
$data = $this->
raw
(self::FIELD_DATA_TYPE);
106
if
(is_null($data)) {
107
return
null
;
108
}
109
$this->dataType = (string) $data;
110
}
111
112
return
$this->dataType
;
113
}
114
119
public
function
getMissing
()
120
{
121
if
(is_null($this->missing)) {
123
$data = $this->
raw
(self::FIELD_MISSING);
124
if
(is_null($data)) {
125
return
null
;
126
}
127
$this->missing = (int) $data;
128
}
129
130
return
$this->missing
;
131
}
132
137
public
function
getTotal
()
138
{
139
if
(is_null($this->total)) {
141
$data = $this->
raw
(self::FIELD_TOTAL);
142
if
(is_null($data)) {
143
return
null
;
144
}
145
$this->total = (int) $data;
146
}
147
148
return
$this->total
;
149
}
150
155
public
function
getOther
()
156
{
157
if
(is_null($this->other)) {
159
$data = $this->
raw
(self::FIELD_OTHER);
160
if
(is_null($data)) {
161
return
null
;
162
}
163
$this->other = (int) $data;
164
}
165
166
return
$this->other
;
167
}
168
173
public
function
getTerms
()
174
{
175
if
(is_null($this->terms)) {
177
$data = $this->
raw
(self::FIELD_TERMS);
178
if
(is_null($data)) {
179
return
null
;
180
}
181
$this->terms =
FacetTermCollection::fromArray
($data);
182
}
183
184
return
$this->terms
;
185
}
186
187
191
public
function
setDataType
(?
string
$dataType
): void
192
{
193
$this->dataType =
$dataType
;
194
}
195
199
public
function
setMissing
(?
int
$missing
): void
200
{
201
$this->missing =
$missing
;
202
}
203
207
public
function
setTotal
(?
int
$total
): void
208
{
209
$this->total =
$total
;
210
}
211
215
public
function
setOther
(?
int
$other
): void
216
{
217
$this->other =
$other
;
218
}
219
223
public
function
setTerms
(?
FacetTermCollection
$terms
): void
224
{
225
$this->terms =
$terms
;
226
}
227
}
Commercetools\Api\Models\Product\FacetTermCollection
Definition
FacetTermCollection.php:22
Commercetools\Api\Models\Product\TermFacetResultModel
Definition
TermFacetResultModel.php:21
Commercetools\Api\Models\Product\TermFacetResultModel\$other
$other
Definition
TermFacetResultModel.php:51
Commercetools\Api\Models\Product\TermFacetResultModel\setTotal
setTotal(?int $total)
Definition
TermFacetResultModel.php:207
Commercetools\Api\Models\Product\TermFacetResultModel\$missing
$missing
Definition
TermFacetResultModel.php:39
Commercetools\Api\Models\Product\TermFacetResultModel\setOther
setOther(?int $other)
Definition
TermFacetResultModel.php:215
Commercetools\Api\Models\Product\TermFacetResultModel\$type
$type
Definition
TermFacetResultModel.php:27
Commercetools\Api\Models\Product\TermFacetResultModel\setDataType
setDataType(?string $dataType)
Definition
TermFacetResultModel.php:191
Commercetools\Api\Models\Product\TermFacetResultModel\__construct
__construct(?string $dataType=null, ?int $missing=null, ?int $total=null, ?int $other=null, ?FacetTermCollection $terms=null, ?string $type=null)
Definition
TermFacetResultModel.php:63
Commercetools\Api\Models\Product\TermFacetResultModel\getTotal
getTotal()
Definition
TermFacetResultModel.php:137
Commercetools\Api\Models\Product\TermFacetResultModel\getTerms
getTerms()
Definition
TermFacetResultModel.php:173
Commercetools\Api\Models\Product\TermFacetResultModel\setTerms
setTerms(?FacetTermCollection $terms)
Definition
TermFacetResultModel.php:223
Commercetools\Api\Models\Product\TermFacetResultModel\$dataType
$dataType
Definition
TermFacetResultModel.php:33
Commercetools\Api\Models\Product\TermFacetResultModel\getMissing
getMissing()
Definition
TermFacetResultModel.php:119
Commercetools\Api\Models\Product\TermFacetResultModel\getType
getType()
Definition
TermFacetResultModel.php:83
Commercetools\Api\Models\Product\TermFacetResultModel\$total
$total
Definition
TermFacetResultModel.php:45
Commercetools\Api\Models\Product\TermFacetResultModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
TermFacetResultModel.php:22
Commercetools\Api\Models\Product\TermFacetResultModel\getDataType
getDataType()
Definition
TermFacetResultModel.php:101
Commercetools\Api\Models\Product\TermFacetResultModel\setMissing
setMissing(?int $missing)
Definition
TermFacetResultModel.php:199
Commercetools\Api\Models\Product\TermFacetResultModel\getOther
getOther()
Definition
TermFacetResultModel.php:155
Commercetools\Api\Models\Product\TermFacetResultModel\$terms
$terms
Definition
TermFacetResultModel.php:57
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\Api\Models\Product\TermFacetResult
Definition
TermFacetResult.php:15
Commercetools\Base\CSequence\fromArray
static fromArray(array $data)
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Product
Definition
AttributeAccessor.php:4
Generated by
1.9.8