src/Entity/ClientAddress.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientAddressRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=ClientAddressRepository::class)
  7. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  8. */
  9. class ClientAddress
  10. {
  11. /**
  12. * @ORM\Id()
  13. * @ORM\GeneratedValue()
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="clientAddresses")
  19. * @ORM\JoinColumn(nullable=true)
  20. */
  21. private $client;
  22. /**
  23. * @ORM\Column(type="string", length=100, nullable=true)
  24. */
  25. protected $firstName;
  26. /**
  27. * @ORM\Column(type="string", length=100, nullable=true)
  28. */
  29. protected $lastName;
  30. /**
  31. * @ORM\Column(type="string", length=100, nullable=true)
  32. */
  33. protected $phone;
  34. /**
  35. * @ORM\Column(type="string", length=150, nullable=true)
  36. */
  37. private $companyName;
  38. /**
  39. * @ORM\Column(type="string", length=10, nullable=true)
  40. */
  41. private $ico;
  42. /**
  43. * @ORM\Column(type="string", length=12, nullable=true)
  44. */
  45. private $dic;
  46. /**
  47. * @ORM\Column(type="string", length=255, nullable=true)
  48. */
  49. private $street;
  50. /**
  51. * @ORM\Column(type="string", length=40, nullable=true)
  52. */
  53. private $streetNumber;
  54. /**
  55. * @ORM\Column(type="string", length=100, nullable=true)
  56. */
  57. private $city;
  58. /**
  59. * @ORM\Column(type="string", length=40, nullable=true)
  60. */
  61. private $country;
  62. /**
  63. * @ORM\Column(type="string", length=10, nullable=true)
  64. */
  65. private $zip;
  66. /**
  67. * @ORM\Column(type="string", length=255, nullable=true)
  68. */
  69. private $note;
  70. /**
  71. * @ORM\Column(type="boolean")
  72. */
  73. private $isCompany = false;
  74. /**
  75. * @ORM\Column(type="datetime")
  76. */
  77. protected $createts;
  78. /**
  79. * @ORM\Column(type="datetime", nullable=true)
  80. */
  81. protected $editts;
  82. /**
  83. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  84. */
  85. protected $editUser;
  86. public function initFromCart(CartAddress $address )
  87. {
  88. $this->setPhone($address->getPhone());
  89. $this->setLastName( $address->getLastName() );
  90. $this->setFirstName( $address->getFirstName() );
  91. $this->setCity( $address->getCity() );
  92. $this->setCompanyName( $address->getCompanyName() );
  93. $this->setIsCompany( $address->getisCompany() );
  94. $this->setCountry( $address->getCountry() );
  95. $this->setDic( $address->getDic() );
  96. $this->setIco( $address->getIco() );
  97. $this->setNote( $address->getNote() );
  98. $this->setStreet( $address->getStreet() );
  99. $this->setStreetNumber( $address->getStreetNumber() );
  100. $this->setZip( $address->getZip() );
  101. return $this;
  102. }
  103. public function getId(): ?int
  104. {
  105. return $this->id;
  106. }
  107. public function getClient(): ?Client
  108. {
  109. return $this->client;
  110. }
  111. public function setClient(?Client $client): self
  112. {
  113. $this->client = $client;
  114. return $this;
  115. }
  116. public function getCompanyName(): ?string
  117. {
  118. return $this->companyName;
  119. }
  120. public function setCompanyName(?string $companyName): self
  121. {
  122. $this->companyName = $companyName;
  123. return $this;
  124. }
  125. public function getIco(): ?string
  126. {
  127. return $this->ico;
  128. }
  129. public function setIco(?string $ico): self
  130. {
  131. $this->ico = $ico;
  132. return $this;
  133. }
  134. public function getDic(): ?string
  135. {
  136. return $this->dic;
  137. }
  138. public function setDic(?string $dic): self
  139. {
  140. $this->dic = $dic;
  141. return $this;
  142. }
  143. public function getStreet(): ?string
  144. {
  145. return $this->street;
  146. }
  147. public function setStreet(?string $street): self
  148. {
  149. $this->street = $street;
  150. return $this;
  151. }
  152. public function getStreetNumber(): ?string
  153. {
  154. return $this->streetNumber;
  155. }
  156. public function setStreetNumber(?string $streetNumber): self
  157. {
  158. $this->streetNumber = $streetNumber;
  159. return $this;
  160. }
  161. public function getCity(): ?string
  162. {
  163. return $this->city;
  164. }
  165. public function setCity(?string $city): self
  166. {
  167. $this->city = $city;
  168. return $this;
  169. }
  170. public function getCountry(): ?string
  171. {
  172. return $this->country;
  173. }
  174. public function setCountry(?string $country): self
  175. {
  176. $this->country = $country;
  177. return $this;
  178. }
  179. public function getZip(): ?string
  180. {
  181. return $this->zip;
  182. }
  183. public function setZip(?string $zip): self
  184. {
  185. $this->zip = $zip;
  186. return $this;
  187. }
  188. public function getCreatets(): ?\DateTimeInterface
  189. {
  190. return $this->createts;
  191. }
  192. public function setCreatets(\DateTimeInterface $createts): self
  193. {
  194. $this->createts = $createts;
  195. return $this;
  196. }
  197. public function getEditts(): ?\DateTimeInterface
  198. {
  199. return $this->editts;
  200. }
  201. public function setEditts(?\DateTimeInterface $editts): self
  202. {
  203. $this->editts = $editts;
  204. return $this;
  205. }
  206. public function getEditUser(): ?User
  207. {
  208. return $this->editUser;
  209. }
  210. public function setEditUser(?User $editUser): self
  211. {
  212. $this->editUser = $editUser;
  213. return $this;
  214. }
  215. /**
  216. * Get Note
  217. *
  218. * @return mixed
  219. */
  220. public function getNote()
  221. {
  222. return $this->note;
  223. }
  224. /**
  225. * Set Note
  226. *
  227. * @param mixed $note
  228. */
  229. public function setNote( $note )
  230. {
  231. $this->note = $note;
  232. }
  233. public function getFullName( )
  234. {
  235. return sprintf('%s %s',$this->getLastName(),$this->getFirstName());
  236. }
  237. public function getFirstName(): ?string
  238. {
  239. return $this->firstName;
  240. }
  241. public function setFirstName(?string $firstName): self
  242. {
  243. $this->firstName = $firstName;
  244. return $this;
  245. }
  246. public function getLastName(): ?string
  247. {
  248. return $this->lastName;
  249. }
  250. public function setLastName(?string $lastName): self
  251. {
  252. $this->lastName = $lastName;
  253. return $this;
  254. }
  255. /**
  256. * Get isCompany
  257. *
  258. * @return mixed
  259. */
  260. public function getisCompany()
  261. {
  262. return $this->isCompany;
  263. }
  264. /**
  265. * Set IsCompany
  266. *
  267. * @param mixed $isCompany
  268. */
  269. public function setIsCompany( $isCompany )
  270. {
  271. $this->isCompany = $isCompany;
  272. }
  273. /**
  274. * Get Phone
  275. *
  276. * @return mixed
  277. */
  278. public function getPhone()
  279. {
  280. return $this->phone;
  281. }
  282. /**
  283. * Set Phone
  284. *
  285. * @param mixed $phone
  286. */
  287. public function setPhone( $phone )
  288. {
  289. $this->phone = $phone;
  290. }
  291. }