src/Entity/Enquiry.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\DeleteTrait;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Gedmo\Timestampable\Traits\TimestampableEntity;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9. * Enquiry.
  10. *
  11. * @Gedmo\Loggable
  12. */
  13. #[ORM\Entity(repositoryClass: \App\Repository\EnquiryRepository::class)]
  14. #[ORM\Table(name: 'enquiry')]
  15. class Enquiry implements \Stringable
  16. {
  17. use DeleteTrait;
  18. use TimestampableEntity;
  19. #[ORM\Column(name: 'id', type: 'integer')]
  20. #[ORM\Id]
  21. #[ORM\GeneratedValue(strategy: 'AUTO')]
  22. private readonly int $id;
  23. #[Assert\NotBlank(message: 'Your name should not be blank')]
  24. #[Assert\Length(min: 3, minMessage: 'Your name must be at least {{ limit }} characters long')]
  25. #[ORM\Column(name: 'name', type: 'string', length: 255)]
  26. private string $name;
  27. #[Assert\NotBlank(message: 'Your contact number should not be blank')]
  28. #[Assert\Length(min: 10, minMessage: 'Your contact number must be at least {{ limit }} characters long')]
  29. #[ORM\Column(name: 'contact_number', type: 'string', length: 255)]
  30. private string $contactNumber;
  31. #[Assert\NotBlank(message: 'Your Email should not be blank')]
  32. #[Assert\Email(message: "The email '{{ value }}' is not a valid email.")]
  33. #[ORM\Column(name: 'email', type: 'string', length: 255)]
  34. private string $email;
  35. #[Assert\NotBlank(message: 'Interested service should not be blank')]
  36. #[Assert\Length(min: 2, minMessage: 'Interested service must be at least {{ limit }} characters long')]
  37. #[ORM\Column(name: 'interested_service', type: 'string', length: 255)]
  38. private string $interestedService;
  39. #[Assert\NotBlank(message: 'Message should not be blank')]
  40. #[Assert\Length(min: 10, minMessage: 'Message must be at least {{ limit }} characters long')]
  41. #[ORM\Column(name: 'message', type: 'text')]
  42. private string $message;
  43. #[ORM\Column(type: 'boolean', nullable: false)]
  44. private bool $viewed = false;
  45. #[ORM\Column(name: 'subject', type: 'string', length: 255)]
  46. private string $subject;
  47. public function __toString(): string
  48. {
  49. return $this->getSubject();
  50. }
  51. public function getId(): int
  52. {
  53. return $this->id;
  54. }
  55. public function setName($name): self
  56. {
  57. $this->name = $name;
  58. return $this;
  59. }
  60. public function getName(): string
  61. {
  62. return $this->name;
  63. }
  64. public function setContactNumber($contactNumber): self
  65. {
  66. $this->contactNumber = $contactNumber;
  67. return $this;
  68. }
  69. public function getContactNumber(): string
  70. {
  71. return $this->contactNumber;
  72. }
  73. public function setEmail($email): self
  74. {
  75. $this->email = $email;
  76. return $this;
  77. }
  78. public function getEmail(): string
  79. {
  80. return $this->email;
  81. }
  82. public function setInterestedService($interestedService): self
  83. {
  84. $this->interestedService = $interestedService;
  85. return $this;
  86. }
  87. public function getInterestedService(): string
  88. {
  89. return $this->interestedService;
  90. }
  91. public function setMessage($message): self
  92. {
  93. $this->message = $message;
  94. return $this;
  95. }
  96. public function getMessage(): string
  97. {
  98. return $this->message;
  99. }
  100. public function setViewed($viewed): self
  101. {
  102. $this->viewed = $viewed;
  103. return $this;
  104. }
  105. public function getViewed(): bool
  106. {
  107. return $this->viewed;
  108. }
  109. public function getSubject(): string
  110. {
  111. return $this->subject;
  112. }
  113. public function setSubject($subject): self
  114. {
  115. $this->subject = $subject;
  116. return $this;
  117. }
  118. }