<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\ScheduleRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ScheduleRepository::class)]
#[ApiResource]
class Schedule
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?string $day = null;
#[ORM\Column(type: Types::TIME_MUTABLE)]
private ?\DateTimeInterface $opened_at = null;
#[ORM\Column(type: Types::TIME_MUTABLE)]
private ?\DateTimeInterface $closed_at = null;
#[ORM\ManyToOne(inversedBy: 'schedules')]
private ?User $user = null;
public function getId(): ?int
{
return $this->id;
}
public function getDay(): ?string
{
return $this->day;
}
public function setDay(string $day): static
{
$this->day = $day;
return $this;
}
public function getOpenedAt(): ?\DateTimeInterface
{
return $this->opened_at;
}
public function setOpenedAt(\DateTimeInterface $opened_at): static
{
$this->opened_at = $opened_at;
return $this;
}
public function getClosedAt(): ?\DateTimeInterface
{
return $this->closed_at;
}
public function setClosedAt(\DateTimeInterface $closed_at): static
{
$this->closed_at = $closed_at;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
}