src/Entity/Timetable.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TimetableRepository;
  4. use DateTimeInterface;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=TimetableRepository::class)
  8.  * @ORM\Table(name="timetables", indexes={
  9.  *     @ORM\Index(name="idx_club_id", columns={"club_id"}),
  10.  *     @ORM\Index(name="idx_start_datetime", columns={"start_datetime"}),
  11.  *     @ORM\Index(name="idx_finish_datetime", columns={"finish_datetime"})
  12.  * })
  13.  */
  14. class Timetable
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private ?int $id null;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="timetables")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private User $user;
  27.     /**
  28.      * @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
  29.      */
  30.     private ?DateTimeInterface $start_datetime null;
  31.     /**
  32.      * @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
  33.      */
  34.     private ?DateTimeInterface $finish_datetime null;
  35.     /**
  36.      * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
  37.      */
  38.     private int $duration 0;
  39.     /**
  40.      * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
  41.      */
  42.     private int $club_id 0;
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getUser(): User
  48.     {
  49.         return $this->user;
  50.     }
  51.     public function setUser(User $user): self
  52.     {
  53.         $this->user $user;
  54.         return $this;
  55.     }
  56.     public function getStartDatetime(): ?DateTimeInterface
  57.     {
  58.         return $this->start_datetime;
  59.     }
  60.     public function setStartDatetime(DateTimeInterface $start_datetime): self
  61.     {
  62.         $this->start_datetime $start_datetime;
  63.         return $this;
  64.     }
  65.     public function getFinishDatetime(): ?DateTimeInterface
  66.     {
  67.         return $this->finish_datetime;
  68.     }
  69.     public function setFinishDatetime(?DateTimeInterface $finish_datetime): self
  70.     {
  71.         $this->finish_datetime $finish_datetime;
  72.         return $this;
  73.     }
  74.     public function getDuration(): ?int
  75.     {
  76.         return $this->duration;
  77.     }
  78.     public function setDuration(int $duration): self
  79.     {
  80.         $this->duration $duration;
  81.         return $this;
  82.     }
  83.     public function getClubId(): int
  84.     {
  85.         return $this->club_id;
  86.     }
  87.     public function setClubId(int $clubId): self
  88.     {
  89.         $this->club_id $clubId;
  90.         return $this;
  91.     }
  92. }