<?php
namespace App\Entity;
use App\Repository\CommentLikeRepository;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
/**
* @ORM\Entity(repositoryClass=CommentLikeRepository::class)
* @Serializer\ExclusionPolicy("ALL")
*/
class CommentLike extends BaseEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Serializer\Expose
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Comment::class, inversedBy="commentLikes")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $comment;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Serializer\Expose
*/
private $hasLiked;
public function getId(): ?int
{
return $this->id;
}
public function getComment(): ?Comment
{
return $this->comment;
}
public function setComment(?Comment $comment): self
{
$this->comment = $comment;
return $this;
}
public function isHasLiked(): ?bool
{
return $this->hasLiked;
}
public function setHasLiked(?bool $hasLiked): self
{
$this->hasLiked = $hasLiked;
return $this;
}
}