<?phpnamespace App\Entity;use App\Repository\DotationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: DotationRepository::class)]class Dotation{ use IdentifiableTrait; #[ORM\ManyToOne(inversedBy: 'dotations')] #[ORM\JoinColumn(nullable: false)] private ?Product $product = null; #[ORM\Column] private ?int $quantity = null; #[ORM\ManyToMany(targetEntity: VisitReport::class, mappedBy: 'productShipmentRequests')] private Collection $visitReportsProductShipmentRequests; #[ORM\ManyToMany(targetEntity: VisitReport::class, mappedBy: 'awardedDotations')] private Collection $visitReportsAwardedDotations; public function __construct() { $this->visitReportsProductShipmentRequests = new ArrayCollection(); $this->visitReportsAwardedDotations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getProduct(): ?Product { return $this->product; } public function setProduct(?Product $product): static { $this->product = $product; return $this; } public function getQuantity(): ?int { return $this->quantity; } public function setQuantity(int $quantity): static { $this->quantity = $quantity; return $this; } /** * @return Collection<int, VisitReport> */ public function getVisitReportsProductShipmentRequests(): Collection { return $this->visitReportsProductShipmentRequests; } public function addVisitReportsProductShipmentRequest(VisitReport $visitReportsProductShipmentRequest): static { if (!$this->visitReportsProductShipmentRequests->contains($visitReportsProductShipmentRequest)) { $this->visitReportsProductShipmentRequests->add($visitReportsProductShipmentRequest); $visitReportsProductShipmentRequest->addProductShipmentRequest($this); } return $this; } public function removeVisitReportsProductShipmentRequest(VisitReport $visitReportsProductShipmentRequest): static { if ($this->visitReportsProductShipmentRequests->removeElement($visitReportsProductShipmentRequest)) { $visitReportsProductShipmentRequest->removeProductShipmentRequest($this); } return $this; } /** * @return Collection<int, VisitReport> */ public function getVisitReportsAwardedDotations(): Collection { return $this->visitReportsAwardedDotations; } public function addVisitReportsAwardedDotation(VisitReport $visitReportsAwardedDotation): static { if (!$this->visitReportsAwardedDotations->contains($visitReportsAwardedDotation)) { $this->visitReportsAwardedDotations->add($visitReportsAwardedDotation); $visitReportsAwardedDotation->addAwardedDotation($this); } return $this; } public function removeVisitReportsAwardedDotation(VisitReport $visitReportsAwardedDotation): static { if ($this->visitReportsAwardedDotations->removeElement($visitReportsAwardedDotation)) { $visitReportsAwardedDotation->removeAwardedDotation($this); } return $this; }}