<?php
namespace App\Entity;
use App\Repository\WardMedicineScheduleRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: WardMedicineScheduleRepository::class), ORM\Table(name: 'ward_medicine_schedules')]
class WardMedicineSchedule implements \Stringable
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Cases::class), ORM\JoinColumn(name: 'case_id', nullable: false)]
private $case;
#[ORM\ManyToOne(targetEntity: CaseMedicine::class), ORM\JoinColumn(name: 'case_medicine_id', nullable: false)]
private $wardMedicine;
#[ORM\Column(type: 'time')]
private $schedule;
#[ORM\Column(type: 'boolean')]
private bool $isGiven = false;
#[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
private $createdAt;
#[Gedmo\Timestampable(on: 'update'), ORM\Column(type: 'datetime')]
private $updatedAt;
#[Gedmo\Blameable(on: 'create'), ORM\ManyToOne(targetEntity: User::class), ORM\JoinColumn(name: 'created_by')]
private $createdBy;
#[Gedmo\Blameable(on: 'update'), ORM\ManyToOne(targetEntity: User::class), ORM\JoinColumn(name: 'updated_by')]
private $updatedBy;
public function getId(): ?int
{
return $this->id;
}
public function getCase(): ?Cases
{
return $this->case;
}
public function setCase(Cases $case): self
{
$this->case = $case;
return $this;
}
public function getWardMedicine(): ?CaseMedicine
{
return $this->wardMedicine;
}
public function setWardMedicine(?CaseMedicine $wardMedicine): self
{
$this->wardMedicine = $wardMedicine;
return $this;
}
public function getSchedule(): ?\DateTimeInterface
{
return $this->schedule;
}
public function setSchedule(\DateTimeInterface $schedule): self
{
$this->schedule = $schedule;
return $this;
}
public function getIsGiven(): ?bool
{
return $this->isGiven;
}
public function setIsGiven(bool $isGiven): self
{
$this->isGiven = $isGiven;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function getUpdatedBy(): ?User
{
return $this->updatedBy;
}
public function __toString(): string
{
return $this->getSchedule()->format('h:i:s a');
}
}