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
103
public
function
getDataType
()
104
{
105
if
(is_null($this->dataType)) {
107
$data = $this->
raw
(self::FIELD_DATA_TYPE);
108
if
(is_null($data)) {
109
return
null
;
110
}
111
$this->dataType = (string) $data;
112
}
113
114
return
$this->dataType
;
115
}
116
123
public
function
getMissing
()
124
{
125
if
(is_null($this->missing)) {
127
$data = $this->
raw
(self::FIELD_MISSING);
128
if
(is_null($data)) {
129
return
null
;
130
}
131
$this->missing = (int) $data;
132
}
133
134
return
$this->missing
;
135
}
136
147
public
function
getTotal
()
148
{
149
if
(is_null($this->total)) {
151
$data = $this->
raw
(self::FIELD_TOTAL);
152
if
(is_null($data)) {
153
return
null
;
154
}
155
$this->total = (int) $data;
156
}
157
158
return
$this->total
;
159
}
160
167
public
function
getOther
()
168
{
169
if
(is_null($this->other)) {
171
$data = $this->
raw
(self::FIELD_OTHER);
172
if
(is_null($data)) {
173
return
null
;
174
}
175
$this->other = (int) $data;
176
}
177
178
return
$this->other
;
179
}
180
189
public
function
getTerms
()
190
{
191
if
(is_null($this->terms)) {
193
$data = $this->
raw
(self::FIELD_TERMS);
194
if
(is_null($data)) {
195
return
null
;
196
}
197
$this->terms =
FacetTermCollection::fromArray
($data);
198
}
199
200
return
$this->terms
;
201
}
202
203
207
public
function
setDataType
(?
string
$dataType
): void
208
{
209
$this->dataType =
$dataType
;
210
}
211
215
public
function
setMissing
(?
int
$missing
): void
216
{
217
$this->missing =
$missing
;
218
}
219
223
public
function
setTotal
(?
int
$total
): void
224
{
225
$this->total =
$total
;
226
}
227
231
public
function
setOther
(?
int
$other
): void
232
{
233
$this->other =
$other
;
234
}
235
239
public
function
setTerms
(?
FacetTermCollection
$terms
): void
240
{
241
$this->terms =
$terms
;
242
}
243
}
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:223
Commercetools\Api\Models\Product\TermFacetResultModel\$missing
$missing
Definition
TermFacetResultModel.php:39
Commercetools\Api\Models\Product\TermFacetResultModel\setOther
setOther(?int $other)
Definition
TermFacetResultModel.php:231
Commercetools\Api\Models\Product\TermFacetResultModel\$type
$type
Definition
TermFacetResultModel.php:27
Commercetools\Api\Models\Product\TermFacetResultModel\setDataType
setDataType(?string $dataType)
Definition
TermFacetResultModel.php:207
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:147
Commercetools\Api\Models\Product\TermFacetResultModel\getTerms
getTerms()
Definition
TermFacetResultModel.php:189
Commercetools\Api\Models\Product\TermFacetResultModel\setTerms
setTerms(?FacetTermCollection $terms)
Definition
TermFacetResultModel.php:239
Commercetools\Api\Models\Product\TermFacetResultModel\$dataType
$dataType
Definition
TermFacetResultModel.php:33
Commercetools\Api\Models\Product\TermFacetResultModel\getMissing
getMissing()
Definition
TermFacetResultModel.php:123
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:103
Commercetools\Api\Models\Product\TermFacetResultModel\setMissing
setMissing(?int $missing)
Definition
TermFacetResultModel.php:215
Commercetools\Api\Models\Product\TermFacetResultModel\getOther
getOther()
Definition
TermFacetResultModel.php:167
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