commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
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
57 public function getDataType()
58 {
59 return $this->dataType;
60 }
61
66 public function getMissing()
67 {
68 return $this->missing;
69 }
70
75 public function getTotal()
76 {
77 return $this->total;
78 }
79
84 public function getOther()
85 {
86 return $this->other;
87 }
88
93 public function getTerms()
94 {
95 return $this->terms;
96 }
97
102 public function withDataType(?string $dataType)
103 {
104 $this->dataType = $dataType;
105
106 return $this;
107 }
108
113 public function withMissing(?int $missing)
114 {
115 $this->missing = $missing;
116
117 return $this;
118 }
119
124 public function withTotal(?int $total)
125 {
126 $this->total = $total;
127
128 return $this;
129 }
130
135 public function withOther(?int $other)
136 {
137 $this->other = $other;
138
139 return $this;
140 }
141
146 public function withTerms(?FacetTermCollection $terms)
147 {
148 $this->terms = $terms;
149
150 return $this;
151 }
152
153
154 public function build(): TermFacetResult
155 {
156 return new TermFacetResultModel(
157 $this->dataType,
158 $this->missing,
159 $this->total,
160 $this->other,
161 $this->terms
162 );
163 }
164
165 public static function of(): TermFacetResultBuilder
166 {
167 return new self();
168 }
169}