src/Entity/PrescriptionPad.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PrescriptionPadRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\UX\Turbo\Attribute\Broadcast;
  8. #[ORM\Entity(repositoryClassPrescriptionPadRepository::class)]
  9. #[Broadcast]
  10. class PrescriptionPad
  11. {
  12.     use IdentifiableTrait;
  13.     #[ORM\Column]
  14.     private ?int $reference null;
  15.     #[ORM\ManyToOne(inversedBy'prescriptionPads')]
  16.     private ?PrescriptionPadOrder $prescriptionPadOrder null;
  17.     #[ORM\OneToMany(mappedBy'prescriptionPad'targetEntityPrescriptionSheet::class, orphanRemovaltrue)]
  18.     private Collection $prescriptionSheets;
  19.     #[ORM\ManyToOne(targetEntityVisitReport::class, inversedBy'prescriptionPads')]
  20.     #[ORM\JoinColumn(name'visit_report_id'referencedColumnName'id')]
  21.     private ?VisitReport $visitReport null;
  22.     #[ORM\ManyToOne(inversedBy'prescriptionPads')]
  23.     private ?User $attributedTo null;
  24.     public function __construct()
  25.     {
  26.         $this->prescriptionSheets = new ArrayCollection();
  27.     }
  28.     public function __toString(): string
  29.     {
  30.         return $this->reference;
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getReference(): ?int
  37.     {
  38.         return $this->reference;
  39.     }
  40.     public function setReference(int $reference): self
  41.     {
  42.         $this->reference $reference;
  43.         return $this;
  44.     }
  45.     public function getPrescriptionPadOrder(): ?PrescriptionPadOrder
  46.     {
  47.         return $this->prescriptionPadOrder;
  48.     }
  49.     public function setPrescriptionPadOrder(?PrescriptionPadOrder $prescriptionPadOrder): self
  50.     {
  51.         $this->prescriptionPadOrder $prescriptionPadOrder;
  52.         return $this;
  53.     }
  54.     /**
  55.      * @return Collection<int, PrescriptionSheet>
  56.      */
  57.     public function getPrescriptionSheets(): Collection
  58.     {
  59.         return $this->prescriptionSheets;
  60.     }
  61.     public function addPrescriptionSheet(PrescriptionSheet $prescriptionSheet): self
  62.     {
  63.         if (!$this->prescriptionSheets->contains($prescriptionSheet)) {
  64.             $this->prescriptionSheets->add($prescriptionSheet);
  65.             $prescriptionSheet->setPrescriptionPad($this);
  66.         }
  67.         return $this;
  68.     }
  69.     public function removePrescriptionSheet(PrescriptionSheet $prescriptionSheet): self
  70.     {
  71.         if ($this->prescriptionSheets->removeElement($prescriptionSheet)) {
  72.             // set the owning side to null (unless already changed)
  73.             if ($prescriptionSheet->getPrescriptionPad() === $this) {
  74.                 $prescriptionSheet->setPrescriptionPad(null);
  75.             }
  76.         }
  77.         return $this;
  78.     }
  79.     public function getVisitReport(): ?VisitReport
  80.     {
  81.         return $this->visitReport;
  82.     }
  83.     public function setVisitReport(?VisitReport $visitReport): static
  84.     {
  85.         $this->visitReport $visitReport;
  86.         return $this;
  87.     }
  88.     public function getAttributedTo(): ?User
  89.     {
  90.         return $this->attributedTo;
  91.     }
  92.     public function setAttributedTo(?User $attributedTo): static
  93.     {
  94.         $this->attributedTo $attributedTo;
  95.         return $this;
  96.     }
  97. }