commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
All Classes Namespaces Functions Variables Pages
TermFacetResultBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class TermFacetResultBuilder implements Builder
22{
27 private $dataType;
28
33 private $missing;
34
39 private $total;
40
45 private $other;
46
51 private $terms;
52
59 public function getDataType()
60 {
61 return $this->dataType;
62 }
63
70 public function getMissing()
71 {
72 return $this->missing;
73 }
74
85 public function getTotal()
86 {
87 return $this->total;
88 }
89
96 public function getOther()
97 {
98 return $this->other;
99 }
100
109 public function getTerms()
110 {
111 return $this->terms;
112 }
113
118 public function withDataType(?string $dataType)
119 {
120 $this->dataType = $dataType;
121
122 return $this;
123 }
124
129 public function withMissing(?int $missing)
130 {
131 $this->missing = $missing;
132
133 return $this;
134 }
135
140 public function withTotal(?int $total)
141 {
142 $this->total = $total;
143
144 return $this;
145 }
146
151 public function withOther(?int $other)
152 {
153 $this->other = $other;
154
155 return $this;
156 }
157
162 public function withTerms(?FacetTermCollection $terms)
163 {
164 $this->terms = $terms;
165
166 return $this;
167 }
168
169
170 public function build(): TermFacetResult
171 {
172 return new TermFacetResultModel(
173 $this->dataType,
174 $this->missing,
175 $this->total,
176 $this->other,
177 $this->terms
178 );
179 }
180
181 public static function of(): TermFacetResultBuilder
182 {
183 return new self();
184 }
185}