src/Entity/CommentLike.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Interfaces\ILikeable;
  4. use App\Repository\CommentLikeRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassCommentLikeRepository::class)]
  7. class CommentLike implements ILikeable
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'commentLikes')]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private $user;
  16.     #[ORM\ManyToOne(targetEntityPostComment::class, inversedBy'commentLikes')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private $comment;
  19.     #[ORM\Column(type'datetime')]
  20.     private $createdAt;
  21.     #[ORM\Column(type'datetime')]
  22.     private $updatedAt;
  23.     #[ORM\Column(type'string'length20nullabletrue)]
  24.     private $emotion;
  25.     public function __construct() {
  26.         $this->createdAt = new \DateTime();
  27.         $this->updatedAt = new \DateTime();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getUser(): ?User
  34.     {
  35.         return $this->user;
  36.     }
  37.     public function setUser(?User $user): self
  38.     {
  39.         $this->user $user;
  40.         return $this;
  41.     }
  42.     public function getComment(): ?PostComment
  43.     {
  44.         return $this->comment;
  45.     }
  46.     public function setComment(?PostComment $comment): self
  47.     {
  48.         $this->comment $comment;
  49.         return $this;
  50.     }
  51.     public function getCreatedAt(): ?\DateTimeInterface
  52.     {
  53.         return $this->createdAt;
  54.     }
  55.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  56.     {
  57.         $this->createdAt $createdAt;
  58.         return $this;
  59.     }
  60.     public function getUpdatedAt(): ?\DateTimeInterface
  61.     {
  62.         return $this->updatedAt;
  63.     }
  64.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  65.     {
  66.         $this->updatedAt $updatedAt;
  67.         return $this;
  68.     }
  69.     public function getEmotion(): ?string
  70.     {
  71.         return $this->emotion;
  72.     }
  73.     public function setEmotion(?string $emotion): self
  74.     {
  75.         $this->emotion $emotion;
  76.         return $this;
  77.     }
  78. }