src\Entity\VideoVisit.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VideoVisitRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassVideoVisitRepository::class)]
  6. class VideoVisit
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length200)]
  13.     private $ip;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $user_agent;
  16.     #[ORM\ManyToOne(targetEntityUser::class)]
  17.     private $user;
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     #[ORM\ManyToOne(targetEntityVideo::class, inversedBy'visits')]
  20.     private $video;
  21.     #[ORM\Column(type'datetime')]
  22.     private $created_at;
  23.     public function __construct()
  24.     {
  25.         $this->created_at=new \DateTime();
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getIp(): ?string
  32.     {
  33.         return $this->ip;
  34.     }
  35.     public function setIp(string $ip): self
  36.     {
  37.         $this->ip $ip;
  38.         return $this;
  39.     }
  40.     public function getUserAgent(): ?string
  41.     {
  42.         return $this->user_agent;
  43.     }
  44.     public function setUserAgent(string $user_agent): self
  45.     {
  46.         $this->user_agent $user_agent;
  47.         return $this;
  48.     }
  49.     public function getUser(): ?User
  50.     {
  51.         return $this->user;
  52.     }
  53.     public function setUser(?User $user): self
  54.     {
  55.         $this->user $user;
  56.         return $this;
  57.     }
  58.     public function getVideo(): ?Video
  59.     {
  60.         return $this->video;
  61.     }
  62.     public function setVideo(?Video $video): self
  63.     {
  64.         $this->video $video;
  65.         return $this;
  66.     }
  67.     public function getCreatedAt(): ?\DateTime
  68.     {
  69.         return $this->created_at;
  70.     }
  71.     public function setCreatedAt(\DateTime $created_at): self
  72.     {
  73.         $this->created_at $created_at;
  74.         return $this;
  75.     }
  76. }