src\Entity\Commentaire.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommentaireRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassCommentaireRepository::class)]
  6. class Commentaire
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\JoinColumn(nullablefalse)]
  13.     #[ORM\ManyToOne(targetEntityUser::class)]
  14.     private $user;
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     #[ORM\ManyToOne(targetEntityNews::class, inversedBy'commentaires')]
  17.     private $news;
  18.     #[ORM\Column(type'text')]
  19.     private $message;
  20.     #[ORM\Column(type'boolean'nullabletrue)]
  21.     private $status;
  22.     #[ORM\Column(type'datetime')]
  23.     private $create_at;
  24.      public function __construct()
  25.     {
  26.         //$this->type = new ArrayCollection();
  27.         $this->status=false;
  28.         $this->create_at=new \DateTime();
  29.         //$this->commentaires = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getUser(): ?User
  36.     {
  37.         return $this->user;
  38.     }
  39.     public function setUser(?User $user): self
  40.     {
  41.         $this->user $user;
  42.         return $this;
  43.     }
  44.     public function getNews(): ?News
  45.     {
  46.         return $this->news;
  47.     }
  48.     public function setNews(?News $news): self
  49.     {
  50.         $this->news $news;
  51.         return $this;
  52.     }
  53.     public function getMessage(): ?string
  54.     {
  55.         return $this->message;
  56.     }
  57.     public function setMessage(string $message): self
  58.     {
  59.         $this->message $message;
  60.         return $this;
  61.     }
  62.     public function getStatus(): ?bool
  63.     {
  64.         return $this->status;
  65.     }
  66.     public function setStatus(bool $status): self
  67.     {
  68.         $this->status $status;
  69.         return $this;
  70.     }
  71.     public function getCreateAt(): ?\DateTimeInterface
  72.     {
  73.         return $this->create_at;
  74.     }
  75.     public function setCreateAt(\DateTimeInterface $create_at): self
  76.     {
  77.         $this->create_at $create_at;
  78.         return $this;
  79.     }
  80. }