src/Entity/Favorite.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FavoriteRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FavoriteRepository::class)
  9.  */
  10. class Favorite
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=TvUser::class, inversedBy="favorites")
  20.      * @ORM\JoinColumn(nullable=true)
  21.      */
  22.     private $tvUser;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="tvFavorites")
  25.      * @ORM\JoinColumn(nullable=true)
  26.      * @Assert\NotNull
  27.      */
  28.     private $user;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=Video::class, inversedBy="favorites")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private $video;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      * @Gedmo\Timestampable(on="create")
  37.      */
  38.     private $createdAt;
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     
  44.     public function getTvUser(): ?TvUser
  45.     {
  46.         return $this->tvUser;
  47.     }
  48.     public function setTvUser(?TvUser $tvUser): self
  49.     {
  50.         $this->tvUser $tvUser;
  51.         return $this;
  52.     }
  53.     public function getUser(): ?User
  54.     {
  55.         return $this->user;
  56.     }
  57.     public function setUser(?User $user): self
  58.     {
  59.         $this->user $user;
  60.         return $this;
  61.     }
  62.     public function getVideo(): ?Video
  63.     {
  64.         return $this->video;
  65.     }
  66.     public function setVideo(?Video $video): self
  67.     {
  68.         $this->video $video;
  69.         return $this;
  70.     }
  71.     public function getCreatedAt(): ?\DateTimeInterface
  72.     {
  73.         return $this->createdAt;
  74.     }
  75.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  76.     {
  77.         $this->createdAt $createdAt;
  78.         return $this;
  79.     }
  80. }