<?php
namespace App\Entity\ReseauSociaux;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use App\Repository\ReseauSociaux\CommentsRepository;
/**
* @ORM\Entity(repositoryClass=CommentsRepository::class)
*/
class Comments
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups("publication:read", "commentaire:read", "post:read", "notif:read")
*/
private $id;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups("commentaire:read", "post:read", "notif:read")
*/
private $content;
/**
* @ORM\Column(type="datetime")
* @Groups("commentaire:read", "post:read", "notif:read")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=150, nullable=true)
* @Groups("commentaire:read", "post:read")
*/
private $photoCommentaire;
/**
* @ORM\ManyToOne(targetEntity=Publication::class, inversedBy="comments")
* @ORM\JoinColumn(nullable=false)
* @Groups("notif:read")
*/
private $publication;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="comments")
* @Groups("commentaire:read", "post:read", "notif:read")
*/
private $author;
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getPhotoCommentaire(): ?string
{
return $this->photoCommentaire;
}
public function setPhotoCommentaire(?string $photoCommentaire): self
{
$this->photoCommentaire = $photoCommentaire;
return $this;
}
public function getPublication(): ?Publication
{
return $this->publication;
}
public function setPublication(?Publication $publication): self
{
$this->publication = $publication;
return $this;
}
public function getAuthor(): ?User
{
return $this->author;
}
public function setAuthor(?User $author): self
{
$this->author = $author;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
}