commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
TaxCategoryBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
22 use DateTimeImmutable;
23 use stdClass;
24 
28 final class TaxCategoryBuilder implements Builder
29 {
34  private $id;
35 
40  private $version;
41 
46  private $createdAt;
47 
52  private $lastModifiedAt;
53 
58  private $lastModifiedBy;
59 
64  private $createdBy;
65 
70  private $name;
71 
76  private $description;
77 
82  private $rates;
83 
88  private $key;
89 
96  public function getId()
97  {
98  return $this->id;
99  }
100 
107  public function getVersion()
108  {
109  return $this->version;
110  }
111 
118  public function getCreatedAt()
119  {
120  return $this->createdAt;
121  }
122 
129  public function getLastModifiedAt()
130  {
131  return $this->lastModifiedAt;
132  }
133 
140  public function getLastModifiedBy()
141  {
142  return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
143  }
144 
151  public function getCreatedBy()
152  {
153  return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
154  }
155 
162  public function getName()
163  {
164  return $this->name;
165  }
166 
173  public function getDescription()
174  {
175  return $this->description;
176  }
177 
184  public function getRates()
185  {
186  return $this->rates;
187  }
188 
195  public function getKey()
196  {
197  return $this->key;
198  }
199 
204  public function withId(?string $id)
205  {
206  $this->id = $id;
207 
208  return $this;
209  }
210 
215  public function withVersion(?int $version)
216  {
217  $this->version = $version;
218 
219  return $this;
220  }
221 
226  public function withCreatedAt(?DateTimeImmutable $createdAt)
227  {
228  $this->createdAt = $createdAt;
229 
230  return $this;
231  }
232 
237  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
238  {
239  $this->lastModifiedAt = $lastModifiedAt;
240 
241  return $this;
242  }
243 
248  public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
249  {
250  $this->lastModifiedBy = $lastModifiedBy;
251 
252  return $this;
253  }
254 
259  public function withCreatedBy(?CreatedBy $createdBy)
260  {
261  $this->createdBy = $createdBy;
262 
263  return $this;
264  }
265 
270  public function withName(?string $name)
271  {
272  $this->name = $name;
273 
274  return $this;
275  }
276 
281  public function withDescription(?string $description)
282  {
283  $this->description = $description;
284 
285  return $this;
286  }
287 
292  public function withRates(?TaxRateCollection $rates)
293  {
294  $this->rates = $rates;
295 
296  return $this;
297  }
298 
303  public function withKey(?string $key)
304  {
305  $this->key = $key;
306 
307  return $this;
308  }
309 
314  public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
315  {
316  $this->lastModifiedBy = $lastModifiedBy;
317 
318  return $this;
319  }
320 
325  public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
326  {
327  $this->createdBy = $createdBy;
328 
329  return $this;
330  }
331 
332  public function build(): TaxCategory
333  {
334  return new TaxCategoryModel(
335  $this->id,
336  $this->version,
337  $this->createdAt,
338  $this->lastModifiedAt,
339  $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
340  $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
341  $this->name,
342  $this->description,
343  $this->rates,
344  $this->key
345  );
346  }
347 
348  public static function of(): TaxCategoryBuilder
349  {
350  return new self();
351  }
352 }
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)