src/Entity/WardMedicineSchedule.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\WardMedicineScheduleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. #[ORM\Entity(repositoryClassWardMedicineScheduleRepository::class), ORM\Table(name'ward_medicine_schedules')]
  7. class WardMedicineSchedule implements \Stringable
  8. {
  9.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer')]
  10.     private $id;
  11.     #[ORM\ManyToOne(targetEntityCases::class), ORM\JoinColumn(name'case_id'nullablefalse)]
  12.     private $case;
  13.     #[ORM\ManyToOne(targetEntityCaseMedicine::class), ORM\JoinColumn(name'case_medicine_id'nullablefalse)]
  14.     private $wardMedicine;
  15.     #[ORM\Column(type'time')]
  16.     private $schedule;
  17.     #[ORM\Column(type'boolean')]
  18.     private bool $isGiven false;
  19.     #[Gedmo\Timestampable(on'create'), ORM\Column(type'datetime')]
  20.     private $createdAt;
  21.     #[Gedmo\Timestampable(on'update'), ORM\Column(type'datetime')]
  22.     private $updatedAt;
  23.     #[Gedmo\Blameable(on'create'), ORM\ManyToOne(targetEntityUser::class), ORM\JoinColumn(name'created_by')]
  24.     private $createdBy;
  25.     #[Gedmo\Blameable(on'update'), ORM\ManyToOne(targetEntityUser::class), ORM\JoinColumn(name'updated_by')]
  26.     private $updatedBy;
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getCase(): ?Cases
  32.     {
  33.         return $this->case;
  34.     }
  35.     public function setCase(Cases $case): self
  36.     {
  37.         $this->case $case;
  38.         return $this;
  39.     }
  40.     public function getWardMedicine(): ?CaseMedicine
  41.     {
  42.         return $this->wardMedicine;
  43.     }
  44.     public function setWardMedicine(?CaseMedicine $wardMedicine): self
  45.     {
  46.         $this->wardMedicine $wardMedicine;
  47.         return $this;
  48.     }
  49.     public function getSchedule(): ?\DateTimeInterface
  50.     {
  51.         return $this->schedule;
  52.     }
  53.     public function setSchedule(\DateTimeInterface $schedule): self
  54.     {
  55.         $this->schedule $schedule;
  56.         return $this;
  57.     }
  58.     public function getIsGiven(): ?bool
  59.     {
  60.         return $this->isGiven;
  61.     }
  62.     public function setIsGiven(bool $isGiven): self
  63.     {
  64.         $this->isGiven $isGiven;
  65.         return $this;
  66.     }
  67.     public function getCreatedAt(): ?\DateTimeInterface
  68.     {
  69.         return $this->createdAt;
  70.     }
  71.     public function getUpdatedAt(): ?\DateTimeInterface
  72.     {
  73.         return $this->updatedAt;
  74.     }
  75.     public function getCreatedBy(): ?User
  76.     {
  77.         return $this->createdBy;
  78.     }
  79.     public function getUpdatedBy(): ?User
  80.     {
  81.         return $this->updatedBy;
  82.     }
  83.     public function __toString(): string
  84.     {
  85.         return $this->getSchedule()->format('h:i:s a');
  86.     }
  87. }