commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ReviewBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
28 use DateTimeImmutable;
29 use stdClass;
30 
34 final class ReviewBuilder implements Builder
35 {
40  private $id;
41 
46  private $version;
47 
52  private $createdAt;
53 
58  private $lastModifiedAt;
59 
64  private $lastModifiedBy;
65 
70  private $createdBy;
71 
76  private $key;
77 
82  private $uniquenessValue;
83 
88  private $locale;
89 
94  private $authorName;
95 
100  private $title;
101 
106  private $text;
107 
112  private $target;
113 
118  private $includedInStatistics;
119 
124  private $rating;
125 
130  private $state;
131 
136  private $customer;
137 
142  private $custom;
143 
150  public function getId()
151  {
152  return $this->id;
153  }
154 
161  public function getVersion()
162  {
163  return $this->version;
164  }
165 
172  public function getCreatedAt()
173  {
174  return $this->createdAt;
175  }
176 
183  public function getLastModifiedAt()
184  {
185  return $this->lastModifiedAt;
186  }
187 
194  public function getLastModifiedBy()
195  {
196  return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
197  }
198 
205  public function getCreatedBy()
206  {
207  return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
208  }
209 
216  public function getKey()
217  {
218  return $this->key;
219  }
220 
227  public function getUniquenessValue()
228  {
229  return $this->uniquenessValue;
230  }
231 
238  public function getLocale()
239  {
240  return $this->locale;
241  }
242 
249  public function getAuthorName()
250  {
251  return $this->authorName;
252  }
253 
260  public function getTitle()
261  {
262  return $this->title;
263  }
264 
271  public function getText()
272  {
273  return $this->text;
274  }
275 
282  public function getTarget()
283  {
284  return $this->target;
285  }
286 
295  public function getIncludedInStatistics()
296  {
297  return $this->includedInStatistics;
298  }
299 
306  public function getRating()
307  {
308  return $this->rating;
309  }
310 
317  public function getState()
318  {
319  return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
320  }
321 
328  public function getCustomer()
329  {
330  return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;
331  }
332 
339  public function getCustom()
340  {
341  return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom;
342  }
343 
348  public function withId(?string $id)
349  {
350  $this->id = $id;
351 
352  return $this;
353  }
354 
359  public function withVersion(?int $version)
360  {
361  $this->version = $version;
362 
363  return $this;
364  }
365 
370  public function withCreatedAt(?DateTimeImmutable $createdAt)
371  {
372  $this->createdAt = $createdAt;
373 
374  return $this;
375  }
376 
381  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
382  {
383  $this->lastModifiedAt = $lastModifiedAt;
384 
385  return $this;
386  }
387 
392  public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
393  {
394  $this->lastModifiedBy = $lastModifiedBy;
395 
396  return $this;
397  }
398 
403  public function withCreatedBy(?CreatedBy $createdBy)
404  {
405  $this->createdBy = $createdBy;
406 
407  return $this;
408  }
409 
414  public function withKey(?string $key)
415  {
416  $this->key = $key;
417 
418  return $this;
419  }
420 
425  public function withUniquenessValue(?string $uniquenessValue)
426  {
427  $this->uniquenessValue = $uniquenessValue;
428 
429  return $this;
430  }
431 
436  public function withLocale(?string $locale)
437  {
438  $this->locale = $locale;
439 
440  return $this;
441  }
442 
447  public function withAuthorName(?string $authorName)
448  {
449  $this->authorName = $authorName;
450 
451  return $this;
452  }
453 
458  public function withTitle(?string $title)
459  {
460  $this->title = $title;
461 
462  return $this;
463  }
464 
469  public function withText(?string $text)
470  {
471  $this->text = $text;
472 
473  return $this;
474  }
475 
480  public function withTarget(?JsonObject $target)
481  {
482  $this->target = $target;
483 
484  return $this;
485  }
486 
491  public function withIncludedInStatistics(?bool $includedInStatistics)
492  {
493  $this->includedInStatistics = $includedInStatistics;
494 
495  return $this;
496  }
497 
502  public function withRating(?int $rating)
503  {
504  $this->rating = $rating;
505 
506  return $this;
507  }
508 
513  public function withState(?StateReference $state)
514  {
515  $this->state = $state;
516 
517  return $this;
518  }
519 
524  public function withCustomer(?CustomerReference $customer)
525  {
526  $this->customer = $customer;
527 
528  return $this;
529  }
530 
535  public function withCustom(?CustomFields $custom)
536  {
537  $this->custom = $custom;
538 
539  return $this;
540  }
541 
546  public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
547  {
548  $this->lastModifiedBy = $lastModifiedBy;
549 
550  return $this;
551  }
552 
557  public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
558  {
559  $this->createdBy = $createdBy;
560 
561  return $this;
562  }
563 
568  public function withStateBuilder(?StateReferenceBuilder $state)
569  {
570  $this->state = $state;
571 
572  return $this;
573  }
574 
579  public function withCustomerBuilder(?CustomerReferenceBuilder $customer)
580  {
581  $this->customer = $customer;
582 
583  return $this;
584  }
585 
590  public function withCustomBuilder(?CustomFieldsBuilder $custom)
591  {
592  $this->custom = $custom;
593 
594  return $this;
595  }
596 
597  public function build(): Review
598  {
599  return new ReviewModel(
600  $this->id,
601  $this->version,
602  $this->createdAt,
603  $this->lastModifiedAt,
604  $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
605  $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
606  $this->key,
607  $this->uniquenessValue,
608  $this->locale,
609  $this->authorName,
610  $this->title,
611  $this->text,
612  $this->target,
613  $this->includedInStatistics,
614  $this->rating,
615  $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
616  $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer,
617  $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom
618  );
619  }
620 
621  public static function of(): ReviewBuilder
622  {
623  return new self();
624  }
625 }
withStateBuilder(?StateReferenceBuilder $state)
withCreatedByBuilder(?CreatedByBuilder $createdBy)
withIncludedInStatistics(?bool $includedInStatistics)
withCustomer(?CustomerReference $customer)
withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
withCustomBuilder(?CustomFieldsBuilder $custom)
withCustomerBuilder(?CustomerReferenceBuilder $customer)
withCreatedAt(?DateTimeImmutable $createdAt)
withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)