<?phpnamespace App\Entity;use App\Repository\PrescriptionPadRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\UX\Turbo\Attribute\Broadcast;#[ORM\Entity(repositoryClass: PrescriptionPadRepository::class)]#[Broadcast]class PrescriptionPad{ use IdentifiableTrait; #[ORM\Column] private ?int $reference = null; #[ORM\ManyToOne(inversedBy: 'prescriptionPads')] private ?PrescriptionPadOrder $prescriptionPadOrder = null; #[ORM\OneToMany(mappedBy: 'prescriptionPad', targetEntity: PrescriptionSheet::class, orphanRemoval: true)] private Collection $prescriptionSheets; #[ORM\ManyToOne(targetEntity: VisitReport::class, inversedBy: 'prescriptionPads')] #[ORM\JoinColumn(name: 'visit_report_id', referencedColumnName: 'id')] private ?VisitReport $visitReport = null; #[ORM\ManyToOne(inversedBy: 'prescriptionPads')] private ?User $attributedTo = null; public function __construct() { $this->prescriptionSheets = new ArrayCollection(); } public function __toString(): string { return $this->reference; } public function getId(): ?int { return $this->id; } public function getReference(): ?int { return $this->reference; } public function setReference(int $reference): self { $this->reference = $reference; return $this; } public function getPrescriptionPadOrder(): ?PrescriptionPadOrder { return $this->prescriptionPadOrder; } public function setPrescriptionPadOrder(?PrescriptionPadOrder $prescriptionPadOrder): self { $this->prescriptionPadOrder = $prescriptionPadOrder; return $this; } /** * @return Collection<int, PrescriptionSheet> */ public function getPrescriptionSheets(): Collection { return $this->prescriptionSheets; } public function addPrescriptionSheet(PrescriptionSheet $prescriptionSheet): self { if (!$this->prescriptionSheets->contains($prescriptionSheet)) { $this->prescriptionSheets->add($prescriptionSheet); $prescriptionSheet->setPrescriptionPad($this); } return $this; } public function removePrescriptionSheet(PrescriptionSheet $prescriptionSheet): self { if ($this->prescriptionSheets->removeElement($prescriptionSheet)) { // set the owning side to null (unless already changed) if ($prescriptionSheet->getPrescriptionPad() === $this) { $prescriptionSheet->setPrescriptionPad(null); } } return $this; } public function getVisitReport(): ?VisitReport { return $this->visitReport; } public function setVisitReport(?VisitReport $visitReport): static { $this->visitReport = $visitReport; return $this; } public function getAttributedTo(): ?User { return $this->attributedTo; } public function setAttributedTo(?User $attributedTo): static { $this->attributedTo = $attributedTo; return $this; }}