src/Entity/Country.php line 13
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\CountryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CountryRepository::class)]#[ApiResource]class Country{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 4)]private ?string $isoCode = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\OneToMany(mappedBy: 'country', targetEntity: Zone::class, orphanRemoval: true)]private Collection $zones;#[ORM\OneToMany(mappedBy: 'country', targetEntity: Provider::class, orphanRemoval: true)]private Collection $providers;#[ORM\OneToMany(mappedBy: 'country', targetEntity: ThirdParty::class, orphanRemoval: true)]private Collection $thirdParties;#[ORM\OneToMany(mappedBy: 'country', targetEntity: Insured::class, orphanRemoval: true)]private Collection $insureds;public function __construct(){$this->zones = new ArrayCollection();$this->providers = new ArrayCollection();$this->thirdParties = new ArrayCollection();$this->insureds = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getIsoCode(): ?string{return $this->isoCode;}public function setIsoCode(string $isoCode): self{$this->isoCode = $isoCode;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}/*** @return Collection<int, Zone>*/public function getZones(): Collection{return $this->zones;}public function addZone(Zone $zone): self{if (!$this->zones->contains($zone)) {$this->zones->add($zone);$zone->setCountry($this);}return $this;}public function removeZone(Zone $zone): self{if ($this->zones->removeElement($zone)) {// set the owning side to null (unless already changed)if ($zone->getCountry() === $this) {$zone->setCountry(null);}}return $this;}/*** @return Collection<int, Provider>*/public function getProviders(): Collection{return $this->providers;}public function addProvider(Provider $provider): self{if (!$this->providers->contains($provider)) {$this->providers->add($provider);$provider->setCountry($this);}return $this;}public function removeProvider(Provider $provider): self{if ($this->providers->removeElement($provider)) {// set the owning side to null (unless already changed)if ($provider->getCountry() === $this) {$provider->setCountry(null);}}return $this;}/*** @return Collection<int, ThirdParty>*/public function getThirdParties(): Collection{return $this->thirdParties;}public function addThirdParty(ThirdParty $thirdParty): self{if (!$this->thirdParties->contains($thirdParty)) {$this->thirdParties->add($thirdParty);$thirdParty->setCountry($this);}return $this;}public function removeThirdParty(ThirdParty $thirdParty): self{if ($this->thirdParties->removeElement($thirdParty)) {// set the owning side to null (unless already changed)if ($thirdParty->getCountry() === $this) {$thirdParty->setCountry(null);}}return $this;}/*** @return Collection<int, Insured>*/public function getInsureds(): Collection{return $this->insureds;}public function addInsured(Insured $insured): self{if (!$this->insureds->contains($insured)) {$this->insureds->add($insured);$insured->setCountry($this);}return $this;}public function removeInsured(Insured $insured): self{if ($this->insureds->removeElement($insured)) {// set the owning side to null (unless already changed)if ($insured->getCountry() === $this) {$insured->setCountry(null);}}return $this;}}