src/Entity/CustomerReview.php line 19

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\CustomerReviewRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass=CustomerReviewRepository::class)
  8. * @ORM\Table(
  9. * name="customer_reviews",
  10. * uniqueConstraints={
  11. * @ORM\UniqueConstraint(name="UNIQ_customer_reviews_review_id", columns={"review_id"})
  12. * }
  13. * )
  14. */
  15. class CustomerReview
  16. {
  17. /**
  18. * @ORM\Id
  19. * @ORM\GeneratedValue
  20. * @ORM\Column(type="integer")
  21. */
  22. private ?int $id = null;
  23. /**
  24. * @ORM\Column(name="review_id", type="string", length=255, unique=true)
  25. */
  26. private string $reviewId;
  27. /**
  28. * @ORM\Column(name="reviewer_profile_photo_url", type="string", length=2048, nullable=true)
  29. */
  30. private ?string $reviewerProfilePhotoUrl = null;
  31. /**
  32. * @ORM\Column(name="reviewer_display_name", type="string", length=255, nullable=true)
  33. */
  34. private ?string $reviewerDisplayName = null;
  35. /**
  36. * @ORM\Column(name="star_rating", type="decimal", precision=3, scale=2)
  37. */
  38. private string $starRating;
  39. /**
  40. * @ORM\Column(type="text", nullable=true)
  41. */
  42. private ?string $comment = null;
  43. /**
  44. * @ORM\Column(name="create_time", type="datetime_immutable")
  45. */
  46. private \DateTimeImmutable $createTime;
  47. /**
  48. * @ORM\Column(name="update_time", type="datetime_immutable")
  49. */
  50. private \DateTimeImmutable $updateTime;
  51. /**
  52. * @ORM\Column(name="review_reply_comment", type="text", nullable=true)
  53. */
  54. private ?string $reviewReplyComment = null;
  55. /**
  56. * @ORM\Column(name="review_reply_update_time", type="datetime_immutable", nullable=true)
  57. */
  58. private ?\DateTimeImmutable $reviewReplyUpdateTime = null;
  59. /**
  60. * @ORM\Column(type="string", length=512)
  61. */
  62. private string $name;
  63. public function __construct(
  64. string $reviewId,
  65. string $name,
  66. string $starRating,
  67. \DateTimeImmutable $createTime,
  68. \DateTimeImmutable $updateTime,
  69. ) {
  70. $this->reviewId = $reviewId;
  71. $this->name = $name;
  72. $this->starRating = $starRating;
  73. $this->createTime = $createTime;
  74. $this->updateTime = $updateTime;
  75. }
  76. public function getId(): ?int
  77. {
  78. return $this->id;
  79. }
  80. public function getReviewId(): string
  81. {
  82. return $this->reviewId;
  83. }
  84. public function getReviewerProfilePhotoUrl(): ?string
  85. {
  86. return $this->reviewerProfilePhotoUrl;
  87. }
  88. public function setReviewerProfilePhotoUrl(?string $reviewerProfilePhotoUrl): self
  89. {
  90. $this->reviewerProfilePhotoUrl = $reviewerProfilePhotoUrl;
  91. return $this;
  92. }
  93. public function getReviewerDisplayName(): ?string
  94. {
  95. return $this->reviewerDisplayName;
  96. }
  97. public function setReviewerDisplayName(?string $reviewerDisplayName): self
  98. {
  99. $this->reviewerDisplayName = $reviewerDisplayName;
  100. return $this;
  101. }
  102. public function getStarRating(): string
  103. {
  104. return $this->starRating;
  105. }
  106. public function getComment(): ?string
  107. {
  108. return $this->comment;
  109. }
  110. public function setComment(?string $comment): self
  111. {
  112. $this->comment = $comment;
  113. return $this;
  114. }
  115. public function getCreateTime(): \DateTimeImmutable
  116. {
  117. return $this->createTime;
  118. }
  119. public function getUpdateTime(): \DateTimeImmutable
  120. {
  121. return $this->updateTime;
  122. }
  123. public function getReviewReplyComment(): ?string
  124. {
  125. return $this->reviewReplyComment;
  126. }
  127. public function setReviewReplyComment(?string $reviewReplyComment): self
  128. {
  129. $this->reviewReplyComment = $reviewReplyComment;
  130. return $this;
  131. }
  132. public function getReviewReplyUpdateTime(): ?\DateTimeImmutable
  133. {
  134. return $this->reviewReplyUpdateTime;
  135. }
  136. public function setReviewReplyUpdateTime(?\DateTimeImmutable $reviewReplyUpdateTime): self
  137. {
  138. $this->reviewReplyUpdateTime = $reviewReplyUpdateTime;
  139. return $this;
  140. }
  141. public function getName(): string
  142. {
  143. return $this->name;
  144. }
  145. }