98 lines
1.9 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\RosterRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RosterRepository::class)]
#[ORM\Index(columns: ['date', 'time'], name: 'idx_date_time')]
class Roster
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $date = null;
#[ORM\Column(type: Types::TIME_IMMUTABLE)]
private ?\DateTimeImmutable $time = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\ManyToOne(inversedBy: 'rosters')]
private ?User $user = null;
#[ORM\ManyToOne]
private ?User $userPrevious = null;
public function getId(): ?int
{
return $this->id;
}
public function getDate(): ?\DateTimeImmutable
{
return $this->date;
}
public function setDate(\DateTimeImmutable $date): static
{
$this->date = $date;
return $this;
}
public function getTime(): ?\DateTimeImmutable
{
return $this->time;
}
public function setTime(\DateTimeImmutable $time): static
{
$this->time = $time;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function getUserPrevious(): ?User
{
return $this->userPrevious;
}
public function setUserPrevious(?User $userPrevious): static
{
$this->userPrevious = $userPrevious;
return $this;
}
}