src/Entity/System/Address.php line 17

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\System;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass="App\Repository\System\AddressRepository")
  7. *
  8. * @ORM\Table(name="ps_address", indexes={
  9. *
  10. * @ORM\Index(name="ps_address_iso_vat_number", columns={"iso_vat_number"}),
  11. * })
  12. */
  13. class Address implements AddressInterface
  14. {
  15. /**
  16. * @var int
  17. *
  18. * @ORM\Id
  19. *
  20. * @ORM\GeneratedValue(strategy="AUTO")
  21. *
  22. * @ORM\Column(type="integer", name="id_address")
  23. */
  24. private $id;
  25. /**
  26. * @var Country
  27. *
  28. * @ORM\ManyToOne(targetEntity="App\Entity\System\Country", inversedBy="addresses")
  29. *
  30. * @ORM\JoinColumn(referencedColumnName="id_country", name="id_country", nullable=false)
  31. */
  32. private $country;
  33. /**
  34. * @var string|null
  35. *
  36. * @ORM\Column(type="string", length=32, nullable=true)
  37. */
  38. private $alias;
  39. /**
  40. * @var string|null
  41. *
  42. * @ORM\Column(type="string", length=64, nullable=true)
  43. */
  44. private $company;
  45. /**
  46. * @var string|null
  47. *
  48. * @ORM\Column(type="text", name="other", nullable=true)
  49. */
  50. private $comments;
  51. /**
  52. * @var \DateTime
  53. *
  54. * @ORM\Column(type="datetime")
  55. */
  56. private $dateAdd;
  57. /**
  58. * @var \DateTime
  59. *
  60. * @ORM\Column(type="datetime")
  61. */
  62. private $dateUpd;
  63. /**
  64. * @var string|null
  65. *
  66. * @ORM\Column(name="comercial_name", type="string", length=128, nullable=true)
  67. */
  68. private $commercialName;
  69. /**
  70. * @var string|null
  71. *
  72. * @ORM\Column(type="string", length=50, nullable=true, options={"default" : "1"})
  73. */
  74. private $contactName;
  75. /**
  76. * @var int
  77. *
  78. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  79. */
  80. private $phonePrefix;
  81. /**
  82. * @var int
  83. *
  84. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  85. */
  86. private $phoneMobilePrefix;
  87. /**
  88. * @var string|null
  89. *
  90. * @ORM\Column(type="string", length=64, nullable=true)
  91. */
  92. private $companyName;
  93. /**
  94. * @var string|null
  95. *
  96. * @ORM\Column(type="string", length=3, nullable=true)
  97. */
  98. private $isoVatNumber;
  99. /**
  100. * @var ?CustomerInvoiceAddress
  101. *
  102. * @ORM\OneToOne(targetEntity="App\Entity\System\CustomerInvoiceAddress", mappedBy="deliveryAddress")
  103. */
  104. private $customerInvoiceAddress;
  105. /**
  106. * @ORM\OneToOne(targetEntity="App\Entity\System\AddressEncrypted", cascade={"persist", "remove"})
  107. *
  108. * @ORM\JoinColumn(name="address_encrypted", referencedColumnName="id")
  109. */
  110. private ?AddressEncrypted $addressEncrypted = null;
  111. private ?string $plainEmail = null;
  112. private ?string $plainName = null;
  113. private ?string $plainSurnames = null;
  114. private ?string $plainPhone = null;
  115. private ?string $plainPhoneMobile = null;
  116. private ?string $plainAddress1 = null;
  117. private ?string $plainAddress2 = null;
  118. private ?string $plainPostcode = null;
  119. private ?string $plainCity = null;
  120. private ?string $plainVatNumber = null;
  121. public function __construct()
  122. {
  123. $this->dateUpd = new \DateTime();
  124. $this->contactName = '1';
  125. $this->phonePrefix = 0;
  126. $this->phoneMobilePrefix = 0;
  127. $this->dateAdd = new \DateTime();
  128. }
  129. public function getId(): int
  130. {
  131. return $this->id;
  132. }
  133. public function setId(int $id): Address
  134. {
  135. $this->id = $id;
  136. return $this;
  137. }
  138. public function getCountry(): Country
  139. {
  140. return $this->country;
  141. }
  142. public function setCountry(Country $country): Address
  143. {
  144. $this->country = $country;
  145. return $this;
  146. }
  147. public function getAlias(): ?string
  148. {
  149. return $this->alias;
  150. }
  151. public function setAlias(?string $alias): Address
  152. {
  153. $this->alias = $alias;
  154. return $this;
  155. }
  156. public function getCompany(): ?string
  157. {
  158. return $this->company;
  159. }
  160. public function setCompany(?string $company): Address
  161. {
  162. $this->company = $company;
  163. return $this;
  164. }
  165. public function getComments(): ?string
  166. {
  167. return $this->comments;
  168. }
  169. public function setComments(?string $comments): Address
  170. {
  171. $this->comments = $comments;
  172. return $this;
  173. }
  174. public function getDateAdd(): \DateTime
  175. {
  176. return $this->dateAdd;
  177. }
  178. public function setDateAdd(\DateTime $dateAdd): Address
  179. {
  180. $this->dateAdd = $dateAdd;
  181. return $this;
  182. }
  183. public function getDateUpd(): \DateTime
  184. {
  185. return $this->dateUpd;
  186. }
  187. public function setDateUpd(\DateTime $dateUpd): Address
  188. {
  189. $this->dateUpd = $dateUpd;
  190. return $this;
  191. }
  192. public function getCommercialName(): ?string
  193. {
  194. return $this->commercialName;
  195. }
  196. public function setCommercialName(?string $commercialName): Address
  197. {
  198. $this->commercialName = $commercialName;
  199. return $this;
  200. }
  201. public function getContactName(): ?string
  202. {
  203. return $this->contactName;
  204. }
  205. public function setContactName(?string $contactName): Address
  206. {
  207. $this->contactName = $contactName;
  208. return $this;
  209. }
  210. public function getPhonePrefix(): int
  211. {
  212. return $this->phonePrefix;
  213. }
  214. public function setPhonePrefix(int $phonePrefix): Address
  215. {
  216. $this->phonePrefix = $phonePrefix;
  217. return $this;
  218. }
  219. public function getPhoneMobilePrefix(): int
  220. {
  221. return $this->phoneMobilePrefix;
  222. }
  223. public function setPhoneMobilePrefix(int $phoneMobilePrefix): Address
  224. {
  225. $this->phoneMobilePrefix = $phoneMobilePrefix;
  226. return $this;
  227. }
  228. public function getCompanyName(): ?string
  229. {
  230. return $this->companyName;
  231. }
  232. public function setCompanyName(?string $companyName): Address
  233. {
  234. $this->companyName = $companyName;
  235. return $this;
  236. }
  237. /**
  238. * @return string|null
  239. */
  240. public function getIsoVatNumber(): ?string
  241. {
  242. return $this->isoVatNumber;
  243. }
  244. /**
  245. * @param string|null $isoVatNumber
  246. *
  247. * @return Address
  248. */
  249. public function setIsoVatNumber(?string $isoVatNumber): self
  250. {
  251. $this->isoVatNumber = $isoVatNumber;
  252. return $this;
  253. }
  254. public function setCustomerInvoiceAddress(CustomerInvoiceAddress $customerInvoiceAddress): self
  255. {
  256. $this->customerInvoiceAddress = $customerInvoiceAddress;
  257. return $this;
  258. }
  259. public function getCustomerInvoiceAddress(): ?CustomerInvoiceAddress
  260. {
  261. return $this->customerInvoiceAddress;
  262. }
  263. public function getAddressEncrypted(): ?AddressEncrypted
  264. {
  265. return $this->addressEncrypted;
  266. }
  267. public function setAddressEncrypted(?AddressEncrypted $addressEncrypted): Address
  268. {
  269. $this->addressEncrypted = $addressEncrypted;
  270. return $this;
  271. }
  272. public function getPlainEmail(): ?string
  273. {
  274. return $this->plainEmail;
  275. }
  276. public function setPlainEmail(?string $plainEmail): Address
  277. {
  278. $this->plainEmail = $plainEmail;
  279. return $this;
  280. }
  281. public function getPlainName(): ?string
  282. {
  283. return $this->plainName;
  284. }
  285. public function setPlainName(?string $plainName): Address
  286. {
  287. $this->plainName = $plainName;
  288. return $this;
  289. }
  290. public function getPlainSurnames(): ?string
  291. {
  292. return $this->plainSurnames;
  293. }
  294. public function setPlainSurnames(?string $plainSurnames): Address
  295. {
  296. $this->plainSurnames = $plainSurnames;
  297. return $this;
  298. }
  299. public function getPlainPhone(): ?string
  300. {
  301. return $this->plainPhone;
  302. }
  303. public function setPlainPhone(?string $plainPhone): Address
  304. {
  305. $this->plainPhone = $plainPhone;
  306. return $this;
  307. }
  308. public function getPlainPhoneMobile(): ?string
  309. {
  310. return $this->plainPhoneMobile;
  311. }
  312. public function setPlainPhoneMobile(?string $plainPhoneMobile): Address
  313. {
  314. $this->plainPhoneMobile = $plainPhoneMobile;
  315. return $this;
  316. }
  317. public function getPlainAddress1(): ?string
  318. {
  319. return $this->plainAddress1;
  320. }
  321. public function setPlainAddress1(?string $plainAddress1): Address
  322. {
  323. $this->plainAddress1 = $plainAddress1;
  324. return $this;
  325. }
  326. public function getPlainAddress2(): ?string
  327. {
  328. return $this->plainAddress2;
  329. }
  330. public function setPlainAddress2(?string $plainAddress2): Address
  331. {
  332. $this->plainAddress2 = $plainAddress2;
  333. return $this;
  334. }
  335. public function getPlainPostcode(): ?string
  336. {
  337. return $this->plainPostcode;
  338. }
  339. public function setPlainPostcode(?string $plainPostcode): Address
  340. {
  341. $this->plainPostcode = $plainPostcode;
  342. return $this;
  343. }
  344. public function getPlainCity(): ?string
  345. {
  346. return $this->plainCity;
  347. }
  348. public function setPlainCity(?string $plainCity): Address
  349. {
  350. $this->plainCity = $plainCity;
  351. return $this;
  352. }
  353. public function getPlainVatNumber(): ?string
  354. {
  355. return $this->plainVatNumber;
  356. }
  357. public function setPlainVatNumber(?string $plainVatNumber): Address
  358. {
  359. $this->plainVatNumber = $plainVatNumber;
  360. return $this;
  361. }
  362. }