src/Entity/CourseViewsStat.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CourseViewsStatRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassCourseViewsStatRepository::class)]
  6. class CourseViewsStat
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255)]
  13.     private $ip;
  14.     #[ORM\ManyToOne(targetEntityCourse::class, inversedBy'courseViewsStats')]
  15.     private $course;
  16.     #[ORM\Column(type'integer')]
  17.     private $views;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $date;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $userAgent null;
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getIp(): ?string
  27.     {
  28.         return $this->ip;
  29.     }
  30.     public function setIp(string $ip): self
  31.     {
  32.         $this->ip $ip;
  33.         return $this;
  34.     }
  35.     public function getCourse(): ?Course
  36.     {
  37.         return $this->course;
  38.     }
  39.     public function setCourse(?Course $course): self
  40.     {
  41.         $this->course $course;
  42.         return $this;
  43.     }
  44.     public function getViews(): ?int
  45.     {
  46.         return $this->views;
  47.     }
  48.     public function setViews(int $views): self
  49.     {
  50.         $this->views $views;
  51.         return $this;
  52.     }
  53.     public function getDate(): ?string
  54.     {
  55.         return $this->date;
  56.     }
  57.     public function setDate(string $date): self
  58.     {
  59.         $this->date $date;
  60.         return $this;
  61.     }
  62.     public function getUserAgent(): ?string
  63.     {
  64.         return $this->userAgent;
  65.     }
  66.     public function setUserAgent(?string $userAgent): static
  67.     {
  68.         $this->userAgent $userAgent;
  69.         return $this;
  70.     }
  71. }