commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Product
FacetTermModel.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
FacetTermModel
extends
JsonObjectModel
implements
FacetTerm
21
{
26
protected
$term
;
27
32
protected
$count
;
33
38
protected
$productCount
;
39
40
44
public
function
__construct
(
45
$term
=
null
,
46
?
int
$count
=
null
,
47
?
int
$productCount
=
null
48
) {
49
$this->term =
$term
;
50
$this->count =
$count
;
51
$this->productCount =
$productCount
;
52
}
53
58
public
function
getTerm
()
59
{
60
if
(is_null($this->term)) {
62
$data = $this->
raw
(self::FIELD_TERM);
63
if
(is_null($data)) {
64
return
null
;
65
}
66
$this->term = $data;
67
}
68
69
return
$this->term
;
70
}
71
76
public
function
getCount
()
77
{
78
if
(is_null($this->count)) {
80
$data = $this->
raw
(self::FIELD_COUNT);
81
if
(is_null($data)) {
82
return
null
;
83
}
84
$this->count = (int) $data;
85
}
86
87
return
$this->count
;
88
}
89
94
public
function
getProductCount
()
95
{
96
if
(is_null($this->productCount)) {
98
$data = $this->
raw
(self::FIELD_PRODUCT_COUNT);
99
if
(is_null($data)) {
100
return
null
;
101
}
102
$this->productCount = (int) $data;
103
}
104
105
return
$this->productCount
;
106
}
107
108
112
public
function
setTerm
(
$term
): void
113
{
114
$this->term =
$term
;
115
}
116
120
public
function
setCount
(?
int
$count
): void
121
{
122
$this->count =
$count
;
123
}
124
128
public
function
setProductCount
(?
int
$productCount
): void
129
{
130
$this->productCount =
$productCount
;
131
}
132
}
Commercetools\Api\Models\Product\FacetTermModel
Definition:
FacetTermModel.php:21
Commercetools\Api\Models\Product\FacetTermModel\$term
$term
Definition:
FacetTermModel.php:26
Commercetools\Api\Models\Product\FacetTermModel\setProductCount
setProductCount(?int $productCount)
Definition:
FacetTermModel.php:128
Commercetools\Api\Models\Product\FacetTermModel\setCount
setCount(?int $count)
Definition:
FacetTermModel.php:120
Commercetools\Api\Models\Product\FacetTermModel\$productCount
$productCount
Definition:
FacetTermModel.php:38
Commercetools\Api\Models\Product\FacetTermModel\setTerm
setTerm($term)
Definition:
FacetTermModel.php:112
Commercetools\Api\Models\Product\FacetTermModel\getTerm
getTerm()
Definition:
FacetTermModel.php:58
Commercetools\Api\Models\Product\FacetTermModel\$count
$count
Definition:
FacetTermModel.php:32
Commercetools\Api\Models\Product\FacetTermModel\__construct
__construct( $term=null, ?int $count=null, ?int $productCount=null)
Definition:
FacetTermModel.php:44
Commercetools\Api\Models\Product\FacetTermModel\getProductCount
getProductCount()
Definition:
FacetTermModel.php:94
Commercetools\Api\Models\Product\FacetTermModel\getCount
getCount()
Definition:
FacetTermModel.php:76
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\FacetTerm
Definition:
FacetTerm.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Product
Definition:
AttributeAccessor.php:4
Generated by
1.9.1