src/Entity/Faq.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FaqRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=FaqRepository::class)
  7. *
  8. * @ORM\HasLifecycleCallbacks()
  9. */
  10. class Faq {
  11. use MetaTrait;
  12. /**
  13. * @ORM\Id
  14. *
  15. * @ORM\GeneratedValue
  16. *
  17. * @ORM\Column(type="integer")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\ManyToOne(targetEntity=Tenant::class, inversedBy="faqs")
  22. *
  23. * @ORM\JoinColumn(nullable=false)
  24. */
  25. private $tenant;
  26. /**
  27. * @ORM\Column(type="string", length=255)
  28. */
  29. private $question;
  30. /**
  31. * @ORM\Column(type="text")
  32. */
  33. private $answer;
  34. public function getId(): ?int {
  35. return $this->id;
  36. }
  37. public function getTenant(): ?Tenant {
  38. return $this->tenant;
  39. }
  40. public function setTenant(?Tenant $tenant): self {
  41. $this->tenant = $tenant;
  42. return $this;
  43. }
  44. public function getQuestion(): ?string {
  45. return $this->question;
  46. }
  47. public function setQuestion(string $question): self {
  48. $this->question = $question;
  49. return $this;
  50. }
  51. public function getAnswer(): ?string {
  52. return $this->answer;
  53. }
  54. public function setAnswer(string $answer): self {
  55. $this->answer = $answer;
  56. return $this;
  57. }
  58. /**
  59. * @ORM\PrePersist
  60. */
  61. public function setDefaults(): self {
  62. return $this
  63. ->setCreatedAt(new \DateTime())
  64. ;
  65. }
  66. /**
  67. * @ORM\PreUpdate
  68. */
  69. public function setModified(): self {
  70. return $this
  71. ->setModifiedAt(new \DateTime())
  72. ;
  73. }
  74. }