src/Entity/ReseauSociaux/Comments.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\ReseauSociaux;
  3. use App\Entity\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use App\Repository\ReseauSociaux\CommentsRepository;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CommentsRepository::class)
  9.  */
  10. class Comments
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      * @Groups("publication:read", "commentaire:read", "post:read", "notif:read")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="text", nullable=true)
  21.      * @Groups("commentaire:read", "post:read", "notif:read")
  22.      */
  23.     private $content;
  24.     /**
  25.      * @ORM\Column(type="datetime")
  26.      * @Groups("commentaire:read", "post:read", "notif:read")
  27.      */
  28.     private $createdAt;
  29.     /**
  30.      * @ORM\Column(type="datetime", nullable=true)
  31.      */
  32.     private $updatedAt;
  33.     /**
  34.      * @ORM\Column(type="string", length=150, nullable=true)
  35.      * @Groups("commentaire:read", "post:read")
  36.      */
  37.     private $photoCommentaire;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=Publication::class, inversedBy="comments")
  40.      * @ORM\JoinColumn(nullable=false)
  41.      * @Groups("notif:read")
  42.      */
  43.     private $publication;
  44.     /**
  45.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="comments")
  46.      * @Groups("commentaire:read", "post:read", "notif:read")
  47.      */
  48.     private $author;
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getCreatedAt(): ?\DateTimeInterface
  54.     {
  55.         return $this->createdAt;
  56.     }
  57.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  58.     {
  59.         $this->createdAt $createdAt;
  60.         return $this;
  61.     }
  62.     public function getUpdatedAt(): ?\DateTimeInterface
  63.     {
  64.         return $this->updatedAt;
  65.     }
  66.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  67.     {
  68.         $this->updatedAt $updatedAt;
  69.         return $this;
  70.     }
  71.     public function getPhotoCommentaire(): ?string
  72.     {
  73.         return $this->photoCommentaire;
  74.     }
  75.     public function setPhotoCommentaire(?string $photoCommentaire): self
  76.     {
  77.         $this->photoCommentaire $photoCommentaire;
  78.         return $this;
  79.     }
  80.     public function getPublication(): ?Publication
  81.     {
  82.         return $this->publication;
  83.     }
  84.     public function setPublication(?Publication $publication): self
  85.     {
  86.         $this->publication $publication;
  87.         return $this;
  88.     }
  89.     public function getAuthor(): ?User
  90.     {
  91.         return $this->author;
  92.     }
  93.     public function setAuthor(?User $author): self
  94.     {
  95.         $this->author $author;
  96.         return $this;
  97.     }
  98.     public function getContent(): ?string
  99.     {
  100.         return $this->content;
  101.     }
  102.     public function setContent(?string $content): self
  103.     {
  104.         $this->content $content;
  105.         return $this;
  106.     }
  107. }