<?php
namespace App\Entity;
use App\Repository\CountryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=CountryRepository::class)
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class Country extends BaseEntity
{
use SoftDeleteableEntity;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=3, nullable=true)
*/
private $iso3;
/**
* @ORM\Column(type="string", length=3, nullable=true)
*/
private $numericCode;
/**
* @ORM\Column(type="string", length=2, nullable=true)
*/
private $iso2;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $phonecode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $capital;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $currency;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $currencyName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $currencySymbol;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $tld;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $native;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $region;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subregion;
/**
* @ORM\Column(type="text")
*/
private $timezones;
/**
* @ORM\Column(type="text")
*/
private $translations;
/**
* @ORM\Column(type="decimal", precision=10, scale=8, nullable=true)
*/
private $latitude;
/**
* @ORM\Column(type="decimal", precision=11, scale=8, nullable=true)
*/
private $longitude;
/**
* @ORM\Column(type="string", length=191, nullable=true)
*/
private $emoji;
/**
* @ORM\Column(name="emojiU", type="string", length=191, nullable=true)
*/
private $emojiU;
/**
* @ORM\Column(type="binary", options={"default": 1})
*/
private $flag;
/**
* @ORM\Column(name="wikiDataId", type="string", length=255, nullable=true)
*/
private $wikiDataId;
/**
* @ORM\OneToMany(targetEntity=State::class, mappedBy="country")
*/
private $states;
/**
* @ORM\OneToMany(targetEntity=City::class, mappedBy="country")
*/
private $cities;
/**
* @ORM\OneToMany(targetEntity=CustomerBilling::class, mappedBy="country")
*/
private $customerBillings;
public function __construct()
{
$this->states = new ArrayCollection();
$this->cities = new ArrayCollection();
$this->customerBillings = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getIso3(): ?string
{
return $this->iso3;
}
public function setIso3(?string $iso3): self
{
$this->iso3 = $iso3;
return $this;
}
public function getNumericCode(): ?string
{
return $this->numericCode;
}
public function setNumericCode(?string $numericCode): self
{
$this->numericCode = $numericCode;
return $this;
}
public function getIso2(): ?string
{
return $this->iso2;
}
public function setIso2(?string $iso2): self
{
$this->iso2 = $iso2;
return $this;
}
public function getPhonecode(): ?string
{
return $this->phonecode;
}
public function setPhonecode(?string $phonecode): self
{
$this->phonecode = $phonecode;
return $this;
}
public function getCapital(): ?string
{
return $this->capital;
}
public function setCapital(?string $capital): self
{
$this->capital = $capital;
return $this;
}
public function getCurrency(): ?string
{
return $this->currency;
}
public function setCurrency(?string $currency): self
{
$this->currency = $currency;
return $this;
}
public function getCurrencyName(): ?string
{
return $this->currencyName;
}
public function setCurrencyName(?string $currencyName): self
{
$this->currencyName = $currencyName;
return $this;
}
public function getCurrencySymbol(): ?string
{
return $this->currencySymbol;
}
public function setCurrencySymbol(?string $currencySymbol): self
{
$this->currencySymbol = $currencySymbol;
return $this;
}
public function getTld(): ?string
{
return $this->tld;
}
public function setTld(?string $tld): self
{
$this->tld = $tld;
return $this;
}
public function getNative(): ?string
{
return $this->native;
}
public function setNative(?string $native): self
{
$this->native = $native;
return $this;
}
public function getRegion(): ?string
{
return $this->region;
}
public function setRegion(?string $region): self
{
$this->region = $region;
return $this;
}
public function getSubregion(): ?string
{
return $this->subregion;
}
public function setSubregion(?string $subregion): self
{
$this->subregion = $subregion;
return $this;
}
public function getTimezones(): ?string
{
return $this->timezones;
}
public function setTimezones(string $timezones): self
{
$this->timezones = $timezones;
return $this;
}
public function getTranslations(): ?string
{
return $this->translations;
}
public function setTranslations(string $translations): self
{
$this->translations = $translations;
return $this;
}
public function getLatitude(): ?string
{
return $this->latitude;
}
public function setLatitude(?string $latitude): self
{
$this->latitude = $latitude;
return $this;
}
public function getLongitude(): ?string
{
return $this->longitude;
}
public function setLongitude(?string $longitude): self
{
$this->longitude = $longitude;
return $this;
}
public function getEmoji(): ?string
{
return $this->emoji;
}
public function setEmoji(?string $emoji): self
{
$this->emoji = $emoji;
return $this;
}
public function getEmojiU(): ?string
{
return $this->emojiU;
}
public function setEmojiU(?string $emojiU): self
{
$this->emojiU = $emojiU;
return $this;
}
public function getFlag()
{
return $this->flag;
}
public function setFlag($flag): self
{
$this->flag = $flag;
return $this;
}
public function getWikiDataId(): ?string
{
return $this->wikiDataId;
}
public function setWikiDataId(?string $wikiDataId): self
{
$this->wikiDataId = $wikiDataId;
return $this;
}
/**
* @return Collection<int, State>
*/
public function getState(): Collection
{
return $this->states;
}
public function addState(State $states): self
{
if (!$this->states->contains($states)) {
$this->states[] = $states;
$states->setCountry($this);
}
return $this;
}
public function removeState(State $states): self
{
if ($this->states->removeElement($states)) {
// set the owning side to null (unless already changed)
if ($states->getCountry() === $this) {
$states->setCountry(null);
}
}
return $this;
}
/**
* @return Collection<int, City>
*/
public function getCities(): Collection
{
return $this->cities;
}
public function addCity(City $city): self
{
if (!$this->cities->contains($city)) {
$this->cities[] = $city;
$city->setCountry($this);
}
return $this;
}
public function removeCity(City $city): self
{
if ($this->cities->removeElement($city)) {
// set the owning side to null (unless already changed)
if ($city->getCountry() === $this) {
$city->setCountry(null);
}
}
return $this;
}
/**
* @return Collection<int, CustomerBilling>
*/
public function getCustomerBillings(): Collection
{
return $this->customerBillings;
}
public function addCustomerBilling(CustomerBilling $customerBilling): self
{
if (!$this->customerBillings->contains($customerBilling)) {
$this->customerBillings[] = $customerBilling;
$customerBilling->setCountry($this);
}
return $this;
}
public function removeCustomerBilling(CustomerBilling $customerBilling): self
{
if ($this->customerBillings->removeElement($customerBilling)) {
// set the owning side to null (unless already changed)
if ($customerBilling->getCountry() === $this) {
$customerBilling->setCountry(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
}