src/Entity/System/Country.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\System\CountryRepository")
  8. *
  9. * @ORM\Table(name="ps_country", indexes={
  10. *
  11. * @ORM\Index(name="country_iso_code", columns={"iso_code"})
  12. * })
  13. */
  14. class Country
  15. {
  16. public const GERMANY_ID = 1;
  17. public const SPAIN_ID = 6;
  18. public const FRANCE_ID = 8;
  19. public const UNITED_KINGDOM = 17;
  20. public const SWITZERLAND_ID = 19;
  21. public const NORWEGIAN_ID = 23;
  22. public const ROMANIA_ID = 36;
  23. public const SPAIN_CODE = 'ES';
  24. public const GREECE_CODE = 'GR';
  25. public const HELLENIC_CODE = 'EL';
  26. public const UNITED_KINGDOM_CODE = 'GB';
  27. public const ITALY_CODE = 'IT';
  28. public const GERMANY_CODE = 'DE';
  29. public const BULGARY_CODE = 'BG';
  30. public const CYPRUS_CODE = 'CY';
  31. public const UNITED_STATES = 'US';
  32. public const BELGIUM_CODE = 'BE';
  33. public const FRANCE_CODE = 'FR';
  34. public const NETHERLANDS_CODE = 'NL';
  35. public const AUSTRIA_CODE = 'AT';
  36. public const CROATIAN_CODE = 'HR';
  37. public const CZECH_CODE = 'CZ';
  38. public const DENMARK_CODE = 'DK';
  39. public const ESTONIAN_CODE = 'EE';
  40. public const FINLAND_CODE = 'FI';
  41. public const HUNGARY_CODE = 'HU';
  42. public const IRELAND_CODE = 'IE';
  43. public const LATVIA_CODE = 'LV';
  44. public const LITHUANIA_CODE = 'LT';
  45. public const LUXEMBURGO_CODE = '';
  46. public const MALTA_CODE = 'MT';
  47. public const SWEDEN_CODE = 'SE';
  48. public const SWITZERLAND_CODE = 'CH';
  49. public const NORWAY_CODE = 'NO';
  50. public const POLAND_CODE = 'PL';
  51. public const PORTUGAL_CODE = 'PT';
  52. public const ROMANIA_CODE = 'RO';
  53. public const SLOVAKIA_CODE = 'SK';
  54. public const SLOVENIA_CODE = 'SI';
  55. public const BRAZIL_CODE = 'BR';
  56. public const COUNTRIES_EXCLUDED_FOR_CATALOG_CECOTEC = [
  57. self::GREECE_CODE,
  58. self::BULGARY_CODE,
  59. self::CYPRUS_CODE,
  60. ];
  61. /**
  62. * @var int
  63. *
  64. * @ORM\Id
  65. *
  66. * @ORM\GeneratedValue(strategy="NONE")
  67. *
  68. * @ORM\Column(type="integer", name="id_country", length=10, options={"unsigned":true})
  69. */
  70. private $id;
  71. /**
  72. * @var Zone
  73. *
  74. * @ORM\ManyToOne(targetEntity="App\Entity\System\Zone")
  75. *
  76. * @ORM\JoinColumn(name="id_zone", referencedColumnName="id_zone", nullable=false)
  77. */
  78. private $zone;
  79. /**
  80. * @var int
  81. *
  82. * @ORM\Column(type="integer")
  83. */
  84. private $idCurrency;
  85. /**
  86. * @var string
  87. *
  88. * @ORM\Column(type="string", length=3)
  89. */
  90. private $isoCode;
  91. /**
  92. * @var int
  93. *
  94. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  95. */
  96. private $callPrefix;
  97. /**
  98. * @var bool
  99. *
  100. * @ORM\Column(type="boolean", length=1)
  101. */
  102. private $active;
  103. /**
  104. * @var bool
  105. *
  106. * @ORM\Column(type="boolean", length=1, options={"default" : 0})
  107. */
  108. private $containsStates;
  109. /**
  110. * @var bool
  111. *
  112. * @ORM\Column(type="boolean", length=1, options={"default" : 0})
  113. */
  114. private $needIdentificationNumber;
  115. /**
  116. * @var bool
  117. *
  118. * @ORM\Column(type="boolean", length=1, options={"default" : 1})
  119. */
  120. private $needZipCode;
  121. /**
  122. * @var string
  123. *
  124. * @ORM\Column(type="string", length=12, options={"default" : ""})
  125. */
  126. private $zipCodeFormat;
  127. /**
  128. * @var bool
  129. *
  130. * @ORM\Column(type="boolean", length=1)
  131. */
  132. private $displayTaxLabel;
  133. /**
  134. * @var bool
  135. *
  136. * @ORM\Column(type="boolean", name="isFreeWarehouse", length=1, options={"default" : 1})
  137. */
  138. private $isFreeWarehouse;
  139. /**
  140. * @var Collection<int, Address>&iterable<Address>
  141. *
  142. * @ORM\OneToMany(targetEntity="App\Entity\System\Address", mappedBy="country")
  143. */
  144. private $addresses;
  145. /**
  146. * @var Collection<int, SynchronisedShopConfiguration>&iterable<SynchronisedShopConfiguration>
  147. *
  148. * @ORM\OneToMany(targetEntity="App\Entity\System\SynchronisedShopConfiguration", mappedBy="countryShopify")
  149. */
  150. private $shopifyShops;
  151. /**
  152. * @var Collection<int, CountryLanguage>&iterable<CountryLanguage>
  153. *
  154. * @ORM\OneToMany(targetEntity="App\Entity\System\CountryLanguage", mappedBy="country")
  155. */
  156. private $countryLanguages;
  157. public function __construct()
  158. {
  159. $this->idCurrency = 0;
  160. $this->callPrefix = 0;
  161. $this->active = false;
  162. $this->containsStates = false;
  163. $this->needIdentificationNumber = false;
  164. $this->needZipCode = true;
  165. $this->zipCodeFormat = '';
  166. $this->isFreeWarehouse = true;
  167. $this->countryLanguages = new ArrayCollection();
  168. $this->addresses = new ArrayCollection();
  169. $this->shopifyShops = new ArrayCollection();
  170. $this->isoCode = '';
  171. }
  172. /**
  173. * @return int
  174. */
  175. public function getId(): int
  176. {
  177. return $this->id;
  178. }
  179. /**
  180. * @param int $id
  181. *
  182. * @return Country
  183. */
  184. public function setId(int $id): Country
  185. {
  186. $this->id = $id;
  187. return $this;
  188. }
  189. /**
  190. * @return Zone
  191. */
  192. public function getZone(): Zone
  193. {
  194. return $this->zone;
  195. }
  196. /**
  197. * @param Zone $zone
  198. *
  199. * @return Country
  200. */
  201. public function setZone(Zone $zone): Country
  202. {
  203. $this->zone = $zone;
  204. return $this;
  205. }
  206. /**
  207. * @return int
  208. */
  209. public function getIdCurrency(): int
  210. {
  211. return $this->idCurrency;
  212. }
  213. /**
  214. * @param int $idCurrency
  215. *
  216. * @return Country
  217. */
  218. public function setIdCurrency(int $idCurrency): Country
  219. {
  220. $this->idCurrency = $idCurrency;
  221. return $this;
  222. }
  223. /**
  224. * @return string
  225. */
  226. public function getIsoCode(): string
  227. {
  228. return $this->isoCode;
  229. }
  230. /**
  231. * @param string $isoCode
  232. *
  233. * @return Country
  234. */
  235. public function setIsoCode(string $isoCode): Country
  236. {
  237. $this->isoCode = $isoCode;
  238. return $this;
  239. }
  240. /**
  241. * @return int
  242. */
  243. public function getCallPrefix(): int
  244. {
  245. return $this->callPrefix;
  246. }
  247. /**
  248. * @param int $callPrefix
  249. *
  250. * @return Country
  251. */
  252. public function setCallPrefix(int $callPrefix): Country
  253. {
  254. $this->callPrefix = $callPrefix;
  255. return $this;
  256. }
  257. /**
  258. * @return bool
  259. */
  260. public function isActive(): bool
  261. {
  262. return $this->active;
  263. }
  264. /**
  265. * @param bool $active
  266. *
  267. * @return Country
  268. */
  269. public function setActive(bool $active): Country
  270. {
  271. $this->active = $active;
  272. return $this;
  273. }
  274. /**
  275. * @return bool
  276. */
  277. public function isContainsStates(): bool
  278. {
  279. return $this->containsStates;
  280. }
  281. /**
  282. * @param bool $containsStates
  283. *
  284. * @return Country
  285. */
  286. public function setContainsStates(bool $containsStates): Country
  287. {
  288. $this->containsStates = $containsStates;
  289. return $this;
  290. }
  291. /**
  292. * @return bool
  293. */
  294. public function isNeedIdentificationNumber(): bool
  295. {
  296. return $this->needIdentificationNumber;
  297. }
  298. /**
  299. * @param bool $needIdentificationNumber
  300. *
  301. * @return Country
  302. */
  303. public function setNeedIdentificationNumber(bool $needIdentificationNumber): Country
  304. {
  305. $this->needIdentificationNumber = $needIdentificationNumber;
  306. return $this;
  307. }
  308. /**
  309. * @return bool
  310. */
  311. public function isNeedZipCode(): bool
  312. {
  313. return $this->needZipCode;
  314. }
  315. /**
  316. * @param bool $needZipCode
  317. *
  318. * @return Country
  319. */
  320. public function setNeedZipCode(bool $needZipCode): Country
  321. {
  322. $this->needZipCode = $needZipCode;
  323. return $this;
  324. }
  325. /**
  326. * @return string
  327. */
  328. public function getZipCodeFormat(): string
  329. {
  330. return $this->zipCodeFormat;
  331. }
  332. /**
  333. * @param string $zipCodeFormat
  334. *
  335. * @return Country
  336. */
  337. public function setZipCodeFormat(string $zipCodeFormat): Country
  338. {
  339. $this->zipCodeFormat = $zipCodeFormat;
  340. return $this;
  341. }
  342. /**
  343. * @return bool
  344. */
  345. public function isDisplayTaxLabel(): bool
  346. {
  347. return $this->displayTaxLabel;
  348. }
  349. /**
  350. * @param bool $displayTaxLabel
  351. *
  352. * @return Country
  353. */
  354. public function setDisplayTaxLabel(bool $displayTaxLabel): Country
  355. {
  356. $this->displayTaxLabel = $displayTaxLabel;
  357. return $this;
  358. }
  359. /**
  360. * @return bool
  361. */
  362. public function isFreeWarehouse(): bool
  363. {
  364. return $this->isFreeWarehouse;
  365. }
  366. /**
  367. * @param bool $isFreeWarehouse
  368. *
  369. * @return Country
  370. */
  371. public function setIsFreeWarehouse(bool $isFreeWarehouse): Country
  372. {
  373. $this->isFreeWarehouse = $isFreeWarehouse;
  374. return $this;
  375. }
  376. /**
  377. * @return Collection<int, Address>&iterable<Address>
  378. */
  379. public function getAddresses()
  380. {
  381. return $this->addresses;
  382. }
  383. /**
  384. * @param Collection<int, Address>&iterable<Address> $addresses
  385. */
  386. public function setAddresses($addresses): Country
  387. {
  388. $this->addresses = $addresses;
  389. return $this;
  390. }
  391. /**
  392. * @return Collection<int, CountryLanguage>&iterable<CountryLanguage>
  393. */
  394. public function getCountryLanguages()
  395. {
  396. return $this->countryLanguages;
  397. }
  398. /**
  399. * @param Collection<int, CountryLanguage>&iterable<CountryLanguage> $countryLanguages
  400. */
  401. public function setCountryLanguages($countryLanguages): self
  402. {
  403. $this->countryLanguages = $countryLanguages;
  404. return $this;
  405. }
  406. /**
  407. * @return Collection<int, SynchronisedShopConfiguration>&iterable<SynchronisedShopConfiguration>
  408. */
  409. public function getShopifyShops()
  410. {
  411. return $this->shopifyShops;
  412. }
  413. /**
  414. * @param Collection<int, SynchronisedShopConfiguration>&iterable<SynchronisedShopConfiguration> $shopifyShops
  415. */
  416. public function setShopifyShops($shopifyShops): Country
  417. {
  418. $this->shopifyShops = $shopifyShops;
  419. return $this;
  420. }
  421. }