src/Entity/OrderAddress.php line 13

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