src/Entity/CommentLike.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommentLikeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use JMS\Serializer\Annotation as Serializer;
  6. /**
  7. * @ORM\Entity(repositoryClass=CommentLikeRepository::class)
  8. * @Serializer\ExclusionPolicy("ALL")
  9. */
  10. class CommentLike extends BaseEntity
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. * @Serializer\Expose
  17. */
  18. private $id;
  19. /**
  20. * @ORM\ManyToOne(targetEntity=Comment::class, inversedBy="commentLikes")
  21. * @ORM\JoinColumn(onDelete="CASCADE")
  22. */
  23. private $comment;
  24. /**
  25. * @ORM\Column(type="boolean", nullable=true)
  26. * @Serializer\Expose
  27. */
  28. private $hasLiked;
  29. public function getId(): ?int
  30. {
  31. return $this->id;
  32. }
  33. public function getComment(): ?Comment
  34. {
  35. return $this->comment;
  36. }
  37. public function setComment(?Comment $comment): self
  38. {
  39. $this->comment = $comment;
  40. return $this;
  41. }
  42. public function isHasLiked(): ?bool
  43. {
  44. return $this->hasLiked;
  45. }
  46. public function setHasLiked(?bool $hasLiked): self
  47. {
  48. $this->hasLiked = $hasLiked;
  49. return $this;
  50. }
  51. }