src/Entity/Country.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CountryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. /**
  8. * @ORM\Entity(repositoryClass=CountryRepository::class)
  9. * @ORM\Table(name="api_geo_country")
  10. */
  11. class Country
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue
  16. * @ORM\Column(type="integer")
  17. */
  18. private ?int $id = null;
  19. /**
  20. * @ORM\Column(type="string", length=100)
  21. */
  22. private string $name;
  23. /**
  24. * @ORM\Column(type="string", length=2, nullable=false, unique=true)
  25. */
  26. private ?string $iso2 = null;
  27. /**
  28. * @ORM\Column(type="string", length=3, nullable=false, unique=true)
  29. */
  30. private ?string $iso3 = null;
  31. /**
  32. * @ORM\Column(type="string", length=50, nullable=true)
  33. */
  34. private ?string $phoneCode = null;
  35. /**
  36. * @ORM\Column(type="string", length=50, nullable=true)
  37. */
  38. private ?string $capital = null;
  39. /**
  40. * @ORM\Column(type="string", length=50, nullable=true)
  41. */
  42. private ?string $currencyCode = null;
  43. /**
  44. * @ORM\Column(type="string", length=50, nullable=true)
  45. */
  46. private ?string $currencyName = null;
  47. /**
  48. * @ORM\Column(type="string", length=50, nullable=true)
  49. */
  50. private ?string $currencySymbol = null;
  51. /**
  52. * @ORM\Column(type="string", length=50, nullable=true)
  53. */
  54. private ?string $region = null;
  55. /**
  56. * @ORM\Column(type="string", length=50, nullable=true)
  57. */
  58. private ?string $subregion = null;
  59. /**
  60. * @ORM\Column(type="string", length=50, nullable=true)
  61. */
  62. private ?string $nationality = null;
  63. /**
  64. * @ORM\Column(type="string", length=50, nullable=true)
  65. */
  66. private ?string $latitude = null;
  67. /**
  68. * @ORM\Column(type="string", length=50, nullable=true)
  69. */
  70. private ?string $longitude = null;
  71. /**
  72. * @ORM\Column(type="string", length=50, nullable=true)
  73. */
  74. private ?string $emoji = null;
  75. /**
  76. * @ORM\Column(type="string", length=50, nullable=true)
  77. */
  78. private ?string $emojiU = null;
  79. /**
  80. * @ORM\Column(type="json")
  81. */
  82. private array $timezones = [];
  83. /**
  84. * @ORM\Column(type="string", length=50, nullable=false, unique=true)
  85. */
  86. private ?string $wikiDataId = null;
  87. /**
  88. * @ORM\OneToMany(targetEntity=State::class, mappedBy="country", cascade={"persist", "remove"})
  89. * @ORM\OrderBy({"name" = "ASC"})
  90. */
  91. private Collection $states;
  92. /**
  93. * @ORM\Column(name="activo", type="integer", nullable=false, options={"comment"="Determina si esta activo 1. Activo 2. Inactivo"})
  94. */
  95. private int $activo;
  96. /**
  97. * @ORM\OneToMany(targetEntity=Cliente::class, mappedBy="country", orphanRemoval=true)
  98. */
  99. private $clientes;
  100. public function __construct()
  101. {
  102. $this->states = new ArrayCollection();
  103. $this->clientes = new ArrayCollection();
  104. }
  105. public function getId(): ?int
  106. {
  107. return $this->id;
  108. }
  109. public function getName(): string
  110. {
  111. return $this->name;
  112. }
  113. public function getIso2(): ?string
  114. {
  115. return $this->iso2;
  116. }
  117. public function getIso3(): ?string
  118. {
  119. return $this->iso3;
  120. }
  121. public function getPhoneCode(): ?string
  122. {
  123. return $this->phoneCode;
  124. }
  125. public function getWikiDataId(): ?string
  126. {
  127. return $this->wikiDataId;
  128. }
  129. public function getStates(): Collection
  130. {
  131. return $this->states;
  132. }
  133. public function getCapital(): ?string
  134. {
  135. return $this->capital;
  136. }
  137. public function getCurrencyCode(): ?string
  138. {
  139. return $this->currencyCode;
  140. }
  141. public function getCurrencyName(): ?string
  142. {
  143. return $this->currencyName;
  144. }
  145. public function getCurrencySymbol(): ?string
  146. {
  147. return $this->currencySymbol;
  148. }
  149. public function getRegion(): ?string
  150. {
  151. return $this->region;
  152. }
  153. public function getSubregion(): ?string
  154. {
  155. return $this->subregion;
  156. }
  157. public function getNationality(): ?string
  158. {
  159. return $this->nationality;
  160. }
  161. public function getLatitude(): ?string
  162. {
  163. return $this->latitude;
  164. }
  165. public function getLongitude(): ?string
  166. {
  167. return $this->longitude;
  168. }
  169. public function getEmoji(): ?string
  170. {
  171. return $this->emoji;
  172. }
  173. public function getEmojiU(): ?string
  174. {
  175. return $this->emojiU;
  176. }
  177. public function getTimezones(): array
  178. {
  179. return $this->timezones;
  180. }
  181. }