commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SearchDateRangeValueBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use DateTimeImmutable;
17 use stdClass;
18 
22 final class SearchDateRangeValueBuilder implements Builder
23 {
28  private $field;
29 
34  private $boost;
35 
40  private $fieldType;
41 
46  private $gte;
47 
52  private $gt;
53 
58  private $lte;
59 
64  private $lt;
65 
70  public function getField()
71  {
72  return $this->field;
73  }
74 
79  public function getBoost()
80  {
81  return $this->boost;
82  }
83 
90  public function getFieldType()
91  {
92  return $this->fieldType;
93  }
94 
99  public function getGte()
100  {
101  return $this->gte;
102  }
103 
108  public function getGt()
109  {
110  return $this->gt;
111  }
112 
117  public function getLte()
118  {
119  return $this->lte;
120  }
121 
126  public function getLt()
127  {
128  return $this->lt;
129  }
130 
135  public function withField(?string $field)
136  {
137  $this->field = $field;
138 
139  return $this;
140  }
141 
146  public function withBoost(?float $boost)
147  {
148  $this->boost = $boost;
149 
150  return $this;
151  }
152 
157  public function withFieldType(?string $fieldType)
158  {
159  $this->fieldType = $fieldType;
160 
161  return $this;
162  }
163 
168  public function withGte(?DateTimeImmutable $gte)
169  {
170  $this->gte = $gte;
171 
172  return $this;
173  }
174 
179  public function withGt(?DateTimeImmutable $gt)
180  {
181  $this->gt = $gt;
182 
183  return $this;
184  }
185 
190  public function withLte(?DateTimeImmutable $lte)
191  {
192  $this->lte = $lte;
193 
194  return $this;
195  }
196 
201  public function withLt(?DateTimeImmutable $lt)
202  {
203  $this->lt = $lt;
204 
205  return $this;
206  }
207 
208 
209  public function build(): SearchDateRangeValue
210  {
211  return new SearchDateRangeValueModel(
212  $this->field,
213  $this->boost,
214  $this->fieldType,
215  $this->gte,
216  $this->gt,
217  $this->lte,
218  $this->lt
219  );
220  }
221 
222  public static function of(): SearchDateRangeValueBuilder
223  {
224  return new self();
225  }
226 }