src/Entity/Insured.php line 14
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\InsuredRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: InsuredRepository::class)]#[ApiResource]class Insured{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $insuredName = null;#[ORM\ManyToOne(inversedBy: 'insureds')]#[ORM\JoinColumn(nullable: false)]private ?Country $country = null;#[ORM\ManyToOne(inversedBy: 'insureds')]#[ORM\JoinColumn(nullable: true)]private ?ThirdParty $thirdParty = null;#[ORM\Column(type: Types::DATE_MUTABLE)]private ?\DateTimeInterface $creationDate = null;#[ORM\OneToMany(mappedBy: 'insured', targetEntity: Coverage::class, orphanRemoval: true)]private Collection $coverages;public function __construct(){$this->coverages = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getInsuredName(): ?string{return $this->insuredName;}public function setInsuredName(string $insuredName): self{$this->insuredName = $insuredName;return $this;}public function getCountry(): ?Country{return $this->country;}public function setCountry(?Country $country): self{$this->country = $country;return $this;}public function getThirdParty(): ?ThirdParty{return $this->thirdParty;}public function setThirdParty(?ThirdParty $thirdParty): self{$this->thirdParty = $thirdParty;return $this;}public function getCreationDate(): ?\DateTimeInterface{return $this->creationDate;}public function setCreationDate(\DateTimeInterface $creationDate): self{$this->creationDate = $creationDate;return $this;}/*** @return Collection<int, Coverage>*/public function getCoverages(): Collection{return $this->coverages;}public function addCoverage(Coverage $coverage): self{if (!$this->coverages->contains($coverage)) {$this->coverages->add($coverage);$coverage->setInsured($this);}return $this;}public function removeCoverage(Coverage $coverage): self{if ($this->coverages->removeElement($coverage)) {// set the owning side to null (unless already changed)if ($coverage->getInsured() === $this) {$coverage->setInsured(null);}}return $this;}}