commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
FacetTermBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class FacetTermBuilder implements Builder
22{
27 private $term;
28
33 private $count;
34
39 private $productCount;
40
47 public function getTerm()
48 {
49 return $this->term;
50 }
51
58 public function getCount()
59 {
60 return $this->count;
61 }
62
70 public function getProductCount()
71 {
72 return $this->productCount;
73 }
74
79 public function withTerm($term)
80 {
81 $this->term = $term;
82
83 return $this;
84 }
85
90 public function withCount(?int $count)
91 {
92 $this->count = $count;
93
94 return $this;
95 }
96
101 public function withProductCount(?int $productCount)
102 {
103 $this->productCount = $productCount;
104
105 return $this;
106 }
107
108
109 public function build(): FacetTerm
110 {
111 return new FacetTermModel(
112 $this->term,
113 $this->count,
114 $this->productCount
115 );
116 }
117
118 public static function of(): FacetTermBuilder
119 {
120 return new self();
121 }
122}