<?php
namespace App\Entity;
use App\Interfaces\ILikeable;
use App\Repository\CommentLikeRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CommentLikeRepository::class)]
class CommentLike implements ILikeable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'commentLikes')]
#[ORM\JoinColumn(nullable: false)]
private $user;
#[ORM\ManyToOne(targetEntity: PostComment::class, inversedBy: 'commentLikes')]
#[ORM\JoinColumn(nullable: false)]
private $comment;
#[ORM\Column(type: 'datetime')]
private $createdAt;
#[ORM\Column(type: 'datetime')]
private $updatedAt;
#[ORM\Column(type: 'string', length: 20, nullable: true)]
private $emotion;
public function __construct() {
$this->createdAt = new \DateTime();
$this->updatedAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getComment(): ?PostComment
{
return $this->comment;
}
public function setComment(?PostComment $comment): self
{
$this->comment = $comment;
return $this;
}
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 getEmotion(): ?string
{
return $this->emotion;
}
public function setEmotion(?string $emotion): self
{
$this->emotion = $emotion;
return $this;
}
}