src/Entity/Comment.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity]
  6. class Comment
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column(type: 'integer')]
  11. private ?int $id = null;
  12. #[ORM\Column(type: 'text')]
  13. private ?string $content = null;
  14. #[ORM\Column(length: 255,nullable: true)]
  15. private ?string $userprofile = null;
  16. #[ORM\Column(type: 'smallint')]
  17. private ?int $rating = null; // Note entre 1 et 5
  18. #[ORM\ManyToOne(targetEntity: Livreurs::class, inversedBy: 'comments')]
  19. #[ORM\JoinColumn(nullable: false)]
  20. private ?Livreurs $deliverer = null;
  21. #[ORM\Column(type: 'datetime')]
  22. private \DateTimeInterface $createdAt;
  23. public function __construct()
  24. {
  25. $this->createdAt = new \DateTimeImmutable();
  26. }
  27. // Getters et setters...
  28. public function getId(): ?int
  29. {
  30. return $this->id;
  31. }
  32. public function getContent(): ?string
  33. {
  34. return $this->content;
  35. }
  36. public function setContent(string $content): static
  37. {
  38. $this->content = $content;
  39. return $this;
  40. }
  41. public function getRating(): ?int
  42. {
  43. return $this->rating;
  44. }
  45. public function setRating(int $rating): static
  46. {
  47. $this->rating = $rating;
  48. return $this;
  49. }
  50. public function getCreatedAt(): ?\DateTimeInterface
  51. {
  52. return $this->createdAt;
  53. }
  54. public function setCreatedAt(\DateTimeInterface $createdAt): static
  55. {
  56. $this->createdAt = $createdAt;
  57. return $this;
  58. }
  59. public function getDeliverer(): ?Livreurs
  60. {
  61. return $this->deliverer;
  62. }
  63. public function setDeliverer(?Livreurs $deliverer): static
  64. {
  65. $this->deliverer = $deliverer;
  66. return $this;
  67. }
  68. public function getUserprofile(): ?string
  69. {
  70. return $this->userprofile;
  71. }
  72. public function setUserprofile(?string $userprofile): static
  73. {
  74. $this->userprofile = $userprofile;
  75. return $this;
  76. }
  77. }