commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
FacetTermBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class FacetTermBuilder implements Builder
22 {
27  private $term;
28 
33  private $count;
34 
39  private $productCount;
40 
45  public function getTerm()
46  {
47  return $this->term;
48  }
49 
54  public function getCount()
55  {
56  return $this->count;
57  }
58 
63  public function getProductCount()
64  {
65  return $this->productCount;
66  }
67 
72  public function withTerm($term)
73  {
74  $this->term = $term;
75 
76  return $this;
77  }
78 
83  public function withCount(?int $count)
84  {
85  $this->count = $count;
86 
87  return $this;
88  }
89 
94  public function withProductCount(?int $productCount)
95  {
96  $this->productCount = $productCount;
97 
98  return $this;
99  }
100 
101 
102  public function build(): FacetTerm
103  {
104  return new FacetTermModel(
105  $this->term,
106  $this->count,
107  $this->productCount
108  );
109  }
110 
111  public static function of(): FacetTermBuilder
112  {
113  return new self();
114  }
115 }