src/Entity/Country.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CountryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. /**
  10.  * @ORM\Entity(repositoryClass=CountryRepository::class)
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12.  */
  13. class Country extends BaseEntity
  14. {
  15.     use SoftDeleteableEntity;
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $name;
  26.     /**
  27.      * @ORM\Column(type="string", length=3, nullable=true)
  28.      */
  29.     private $iso3;
  30.     /**
  31.      * @ORM\Column(type="string", length=3, nullable=true)
  32.      */
  33.     private $numericCode;
  34.     /**
  35.      * @ORM\Column(type="string", length=2, nullable=true)
  36.      */
  37.     private $iso2;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $phonecode;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $capital;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $currency;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private $currencyName;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private $currencySymbol;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private $tld;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $native;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private $region;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $subregion;
  74.     /**
  75.      * @ORM\Column(type="text")
  76.      */
  77.     private $timezones;
  78.     /**
  79.      * @ORM\Column(type="text")
  80.      */
  81.     private $translations;
  82.     /**
  83.      * @ORM\Column(type="decimal", precision=10, scale=8, nullable=true)
  84.      */
  85.     private $latitude;
  86.     /**
  87.      * @ORM\Column(type="decimal", precision=11, scale=8, nullable=true)
  88.      */
  89.     private $longitude;
  90.     /**
  91.      * @ORM\Column(type="string", length=191, nullable=true)
  92.      */
  93.     private $emoji;
  94.     /**
  95.      * @ORM\Column(name="emojiU", type="string", length=191, nullable=true)
  96.      */
  97.     private $emojiU;
  98.     /**
  99.      * @ORM\Column(type="binary", options={"default": 1})
  100.      */
  101.     private $flag;
  102.     /**
  103.      * @ORM\Column(name="wikiDataId", type="string", length=255, nullable=true)
  104.      */
  105.     private $wikiDataId;
  106.     /**
  107.      * @ORM\OneToMany(targetEntity=State::class, mappedBy="country")
  108.      */
  109.     private $states;
  110.     /**
  111.      * @ORM\OneToMany(targetEntity=City::class, mappedBy="country")
  112.      */
  113.     private $cities;
  114.     /**
  115.      * @ORM\OneToMany(targetEntity=CustomerBilling::class, mappedBy="country")
  116.      */
  117.     private $customerBillings;
  118.     public function __construct()
  119.     {
  120.         $this->states = new ArrayCollection();
  121.         $this->cities = new ArrayCollection();
  122.         $this->customerBillings = new ArrayCollection();
  123.     }
  124.     public function getId(): ?int
  125.     {
  126.         return $this->id;
  127.     }
  128.     public function getName(): ?string
  129.     {
  130.         return $this->name;
  131.     }
  132.     public function setName(string $name): self
  133.     {
  134.         $this->name $name;
  135.         return $this;
  136.     }
  137.     public function getIso3(): ?string
  138.     {
  139.         return $this->iso3;
  140.     }
  141.     public function setIso3(?string $iso3): self
  142.     {
  143.         $this->iso3 $iso3;
  144.         return $this;
  145.     }
  146.     public function getNumericCode(): ?string
  147.     {
  148.         return $this->numericCode;
  149.     }
  150.     public function setNumericCode(?string $numericCode): self
  151.     {
  152.         $this->numericCode $numericCode;
  153.         return $this;
  154.     }
  155.     public function getIso2(): ?string
  156.     {
  157.         return $this->iso2;
  158.     }
  159.     public function setIso2(?string $iso2): self
  160.     {
  161.         $this->iso2 $iso2;
  162.         return $this;
  163.     }
  164.     public function getPhonecode(): ?string
  165.     {
  166.         return $this->phonecode;
  167.     }
  168.     public function setPhonecode(?string $phonecode): self
  169.     {
  170.         $this->phonecode $phonecode;
  171.         return $this;
  172.     }
  173.     public function getCapital(): ?string
  174.     {
  175.         return $this->capital;
  176.     }
  177.     public function setCapital(?string $capital): self
  178.     {
  179.         $this->capital $capital;
  180.         return $this;
  181.     }
  182.     public function getCurrency(): ?string
  183.     {
  184.         return $this->currency;
  185.     }
  186.     public function setCurrency(?string $currency): self
  187.     {
  188.         $this->currency $currency;
  189.         return $this;
  190.     }
  191.     public function getCurrencyName(): ?string
  192.     {
  193.         return $this->currencyName;
  194.     }
  195.     public function setCurrencyName(?string $currencyName): self
  196.     {
  197.         $this->currencyName $currencyName;
  198.         return $this;
  199.     }
  200.     public function getCurrencySymbol(): ?string
  201.     {
  202.         return $this->currencySymbol;
  203.     }
  204.     public function setCurrencySymbol(?string $currencySymbol): self
  205.     {
  206.         $this->currencySymbol $currencySymbol;
  207.         return $this;
  208.     }
  209.     public function getTld(): ?string
  210.     {
  211.         return $this->tld;
  212.     }
  213.     public function setTld(?string $tld): self
  214.     {
  215.         $this->tld $tld;
  216.         return $this;
  217.     }
  218.     public function getNative(): ?string
  219.     {
  220.         return $this->native;
  221.     }
  222.     public function setNative(?string $native): self
  223.     {
  224.         $this->native $native;
  225.         return $this;
  226.     }
  227.     public function getRegion(): ?string
  228.     {
  229.         return $this->region;
  230.     }
  231.     public function setRegion(?string $region): self
  232.     {
  233.         $this->region $region;
  234.         return $this;
  235.     }
  236.     public function getSubregion(): ?string
  237.     {
  238.         return $this->subregion;
  239.     }
  240.     public function setSubregion(?string $subregion): self
  241.     {
  242.         $this->subregion $subregion;
  243.         return $this;
  244.     }
  245.     public function getTimezones(): ?string
  246.     {
  247.         return $this->timezones;
  248.     }
  249.     public function setTimezones(string $timezones): self
  250.     {
  251.         $this->timezones $timezones;
  252.         return $this;
  253.     }
  254.     public function getTranslations(): ?string
  255.     {
  256.         return $this->translations;
  257.     }
  258.     public function setTranslations(string $translations): self
  259.     {
  260.         $this->translations $translations;
  261.         return $this;
  262.     }
  263.     public function getLatitude(): ?string
  264.     {
  265.         return $this->latitude;
  266.     }
  267.     public function setLatitude(?string $latitude): self
  268.     {
  269.         $this->latitude $latitude;
  270.         return $this;
  271.     }
  272.     public function getLongitude(): ?string
  273.     {
  274.         return $this->longitude;
  275.     }
  276.     public function setLongitude(?string $longitude): self
  277.     {
  278.         $this->longitude $longitude;
  279.         return $this;
  280.     }
  281.     public function getEmoji(): ?string
  282.     {
  283.         return $this->emoji;
  284.     }
  285.     public function setEmoji(?string $emoji): self
  286.     {
  287.         $this->emoji $emoji;
  288.         return $this;
  289.     }
  290.     public function getEmojiU(): ?string
  291.     {
  292.         return $this->emojiU;
  293.     }
  294.     public function setEmojiU(?string $emojiU): self
  295.     {
  296.         $this->emojiU $emojiU;
  297.         return $this;
  298.     }
  299.     public function getFlag()
  300.     {
  301.         return $this->flag;
  302.     }
  303.     public function setFlag($flag): self
  304.     {
  305.         $this->flag $flag;
  306.         return $this;
  307.     }
  308.     public function getWikiDataId(): ?string
  309.     {
  310.         return $this->wikiDataId;
  311.     }
  312.     public function setWikiDataId(?string $wikiDataId): self
  313.     {
  314.         $this->wikiDataId $wikiDataId;
  315.         return $this;
  316.     }
  317.     /**
  318.      * @return Collection<int, State>
  319.      */
  320.     public function getState(): Collection
  321.     {
  322.         return $this->states;
  323.     }
  324.     public function addState(State $states): self
  325.     {
  326.         if (!$this->states->contains($states)) {
  327.             $this->states[] = $states;
  328.             $states->setCountry($this);
  329.         }
  330.         return $this;
  331.     }
  332.     public function removeState(State $states): self
  333.     {
  334.         if ($this->states->removeElement($states)) {
  335.             // set the owning side to null (unless already changed)
  336.             if ($states->getCountry() === $this) {
  337.                 $states->setCountry(null);
  338.             }
  339.         }
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return Collection<int, City>
  344.      */
  345.     public function getCities(): Collection
  346.     {
  347.         return $this->cities;
  348.     }
  349.     public function addCity(City $city): self
  350.     {
  351.         if (!$this->cities->contains($city)) {
  352.             $this->cities[] = $city;
  353.             $city->setCountry($this);
  354.         }
  355.         return $this;
  356.     }
  357.     public function removeCity(City $city): self
  358.     {
  359.         if ($this->cities->removeElement($city)) {
  360.             // set the owning side to null (unless already changed)
  361.             if ($city->getCountry() === $this) {
  362.                 $city->setCountry(null);
  363.             }
  364.         }
  365.         return $this;
  366.     }
  367.     /**
  368.      * @return Collection<int, CustomerBilling>
  369.      */
  370.     public function getCustomerBillings(): Collection
  371.     {
  372.         return $this->customerBillings;
  373.     }
  374.     public function addCustomerBilling(CustomerBilling $customerBilling): self
  375.     {
  376.         if (!$this->customerBillings->contains($customerBilling)) {
  377.             $this->customerBillings[] = $customerBilling;
  378.             $customerBilling->setCountry($this);
  379.         }
  380.         return $this;
  381.     }
  382.     public function removeCustomerBilling(CustomerBilling $customerBilling): self
  383.     {
  384.         if ($this->customerBillings->removeElement($customerBilling)) {
  385.             // set the owning side to null (unless already changed)
  386.             if ($customerBilling->getCountry() === $this) {
  387.                 $customerBilling->setCountry(null);
  388.             }
  389.         }
  390.         return $this;
  391.     }
  392.     public function __toString()
  393.     {
  394.         return $this->name;
  395.     }
  396. }