src/Entity/WishListLike.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTimeImmutable;
  4. use Doctrine\Common\Collections\Collection;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Doctrine\ORM\Mapping\UniqueConstraint;
  8. use Doctrine\ORM\Mapping\Table;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\WishListLikeRepository")
  11.  * @Table(name="wish_list_like",
  12.  *    uniqueConstraints={
  13.  *        @UniqueConstraint(name="unique_like",
  14.  *            columns={"wish_list_id", "user_id"})
  15.  *    }
  16.  * )
  17.  */
  18. class WishListLike
  19. {
  20.     /**
  21.      * @ORM\Id()
  22.      * @ORM\GeneratedValue()
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $isLike true;
  30.     /**
  31.      * @ORM\Column(type="datetime_immutable")
  32.      */
  33.     private $created;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\WishList", inversedBy="wishListLikes")
  36.      */
  37.     private $wishList;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="userLikes")
  40.      */
  41.     private $user;
  42.     public function __construct()
  43.     {
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getIsLike(): ?bool
  50.     {
  51.         return $this->isLike;
  52.     }
  53.     public function setIsLike(bool $like): self
  54.     {
  55.         $this->isLike $like;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return DateTimeImmutable|null
  60.      */
  61.     public function getCreated(): ?DateTimeImmutable
  62.     {
  63.         return $this->created;
  64.     }
  65.     /**
  66.      * @param DateTimeImmutable $created
  67.      * @return $this
  68.      */
  69.     public function setCreated(DateTimeImmutable $created): self
  70.     {
  71.         $this->created $created;
  72.         return $this;
  73.     }
  74.     /**
  75.      * @return WishList
  76.      */
  77.     public function getWishList(): ?WishList
  78.     {
  79.         return $this->wishList;
  80.     }
  81.     /**
  82.      * @param WishList $wishList
  83.      *
  84.      * @return WishListLike
  85.      */
  86.     public function setWishList(WishList $wishList): self
  87.     {
  88.         $this->wishList $wishList;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return User|null
  93.      */
  94.     public function getUser(): ?User
  95.     {
  96.         return $this->users;
  97.     }
  98.     public function setUser(?User $user): self
  99.     {
  100.         $this->user $user;
  101.         return $this;
  102.     }
  103. }