<?php
namespace App\Entity;
use App\Repository\TimetableRepository;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TimetableRepository::class)
* @ORM\Table(name="timetables", indexes={
* @ORM\Index(name="idx_club_id", columns={"club_id"}),
* @ORM\Index(name="idx_start_datetime", columns={"start_datetime"}),
* @ORM\Index(name="idx_finish_datetime", columns={"finish_datetime"})
* })
*/
class Timetable
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="timetables")
* @ORM\JoinColumn(nullable=false)
*/
private User $user;
/**
* @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
*/
private ?DateTimeInterface $start_datetime = null;
/**
* @ORM\Column(type="datetime", nullable=true, columnDefinition="TIMESTAMP DEFAULT NULL")
*/
private ?DateTimeInterface $finish_datetime = null;
/**
* @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
*/
private int $duration = 0;
/**
* @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
*/
private int $club_id = 0;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): User
{
return $this->user;
}
public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
public function getStartDatetime(): ?DateTimeInterface
{
return $this->start_datetime;
}
public function setStartDatetime(DateTimeInterface $start_datetime): self
{
$this->start_datetime = $start_datetime;
return $this;
}
public function getFinishDatetime(): ?DateTimeInterface
{
return $this->finish_datetime;
}
public function setFinishDatetime(?DateTimeInterface $finish_datetime): self
{
$this->finish_datetime = $finish_datetime;
return $this;
}
public function getDuration(): ?int
{
return $this->duration;
}
public function setDuration(int $duration): self
{
$this->duration = $duration;
return $this;
}
public function getClubId(): int
{
return $this->club_id;
}
public function setClubId(int $clubId): self
{
$this->club_id = $clubId;
return $this;
}
}