Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Address.php 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\MappedSuperclass()
  8. */
  9. abstract class Address extends AbstractEntity
  10. {
  11. /**
  12. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="addresses")
  13. * @ORM\JoinColumn(nullable=true)
  14. */
  15. protected $user;
  16. /**
  17. * @ORM\Column(type="string", length=255)
  18. */
  19. protected $title;
  20. /**
  21. * @ORM\Column(type="string", length=31)
  22. */
  23. protected $type;
  24. /**
  25. * @ORM\Column(type="boolean", nullable=true)
  26. */
  27. protected $civility;
  28. /**
  29. * @ORM\Column(type="string", length=127, nullable=true)
  30. */
  31. protected $lastname;
  32. /**
  33. * @ORM\Column(type="string", length=127, nullable=true)
  34. */
  35. protected $firstname;
  36. /**
  37. * @ORM\Column(type="text")
  38. */
  39. protected $address;
  40. /**
  41. * @ORM\Column(type="string", length=31)
  42. */
  43. protected $zip;
  44. /**
  45. * @ORM\Column(type="string", length=255)
  46. */
  47. protected $city;
  48. /**
  49. * @ORM\Column(type="string", length=255)
  50. */
  51. protected $country;
  52. /**
  53. * @ORM\Column(type="string", length=255, nullable=true)
  54. */
  55. protected $company;
  56. /**
  57. * @ORM\Column(type="string", length=127, nullable=true)
  58. */
  59. protected $siret;
  60. /**
  61. * @ORM\Column(type="string", length=127, nullable=true)
  62. */
  63. protected $tva;
  64. /**
  65. * @ORM\Column(type="string", length=127, nullable=true)
  66. */
  67. protected $phone;
  68. /**
  69. * @ORM\Column(type="text", nullable=true)
  70. */
  71. protected $comment;
  72. /**
  73. * @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\PointSaleInterface", mappedBy="address", cascade={"persist", "remove"})
  74. */
  75. protected $pointSale;
  76. /**
  77. * @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", mappedBy="address", cascade={"persist", "remove"})
  78. */
  79. protected $merchant;
  80. public function __toString()
  81. {
  82. return $this->getTitle() ;
  83. }
  84. public function getUser(): ?User
  85. {
  86. return $this->user;
  87. }
  88. public function setUser(?User $user): self
  89. {
  90. $this->user = $user;
  91. return $this;
  92. }
  93. public function getTitle(): ?string
  94. {
  95. return $this->title;
  96. }
  97. public function setTitle(string $title): self
  98. {
  99. $this->title = $title;
  100. return $this;
  101. }
  102. public function getType(): ?string
  103. {
  104. return $this->type;
  105. }
  106. public function setType(string $type): self
  107. {
  108. $this->type = $type;
  109. return $this;
  110. }
  111. public function getCivility(): ?bool
  112. {
  113. return $this->civility;
  114. }
  115. public function setCivility(?bool $civility): self
  116. {
  117. $this->civility = $civility;
  118. return $this;
  119. }
  120. public function getLastname(): ?string
  121. {
  122. return $this->lastname;
  123. }
  124. public function setLastname(?string $lastname): self
  125. {
  126. $this->lastname = $lastname;
  127. return $this;
  128. }
  129. public function getFirstname(): ?string
  130. {
  131. return $this->firstname;
  132. }
  133. public function setFirstname(?string $firstname): self
  134. {
  135. $this->firstname = $firstname;
  136. return $this;
  137. }
  138. public function getAddress(): ?string
  139. {
  140. return $this->address;
  141. }
  142. public function setAddress(string $address): self
  143. {
  144. $this->address = $address;
  145. return $this;
  146. }
  147. public function getZip(): ?string
  148. {
  149. return $this->zip;
  150. }
  151. public function setZip(string $zip): self
  152. {
  153. $this->zip = $zip;
  154. return $this;
  155. }
  156. public function getCity(): ?string
  157. {
  158. return $this->city;
  159. }
  160. public function setCity(string $city): self
  161. {
  162. $this->city = $city;
  163. return $this;
  164. }
  165. public function getCountry(): ?string
  166. {
  167. return $this->country;
  168. }
  169. public function setCountry(string $country): self
  170. {
  171. $this->country = $country;
  172. return $this;
  173. }
  174. public function getCompany(): ?string
  175. {
  176. return $this->company;
  177. }
  178. public function setCompany(?string $company): self
  179. {
  180. $this->company = $company;
  181. return $this;
  182. }
  183. public function getSiret(): ?string
  184. {
  185. return $this->siret;
  186. }
  187. public function setSiret(?string $siret): self
  188. {
  189. $this->siret = $siret;
  190. return $this;
  191. }
  192. public function getTva(): ?string
  193. {
  194. return $this->tva;
  195. }
  196. public function setTva(?string $tva): self
  197. {
  198. $this->tva = $tva;
  199. return $this;
  200. }
  201. public function getPhone(): ?string
  202. {
  203. return $this->phone;
  204. }
  205. public function setPhone(?string $phone): self
  206. {
  207. $this->phone = $phone;
  208. return $this;
  209. }
  210. public function getComment(): ?string
  211. {
  212. return $this->comment;
  213. }
  214. public function setComment(?string $comment): self
  215. {
  216. $this->comment = $comment;
  217. return $this;
  218. }
  219. public function getPointSale(): ?PointSale
  220. {
  221. return $this->pointSale;
  222. }
  223. public function setPointSale(PointSale $pointSale): self
  224. {
  225. $this->pointSale = $pointSale;
  226. // set the owning side of the relation if necessary
  227. if ($pointSale->getAddress() !== $this) {
  228. $pointSale->setAddress($this);
  229. }
  230. return $this;
  231. }
  232. public function getMerchant(): ?Merchant
  233. {
  234. return $this->merchant;
  235. }
  236. public function setMerchant(Merchant $merchant): self
  237. {
  238. $this->merchant = $merchant;
  239. // set the owning side of the relation if necessary
  240. if ($merchant->getAddress() !== $this) {
  241. $merchant->setAddress($this);
  242. }
  243. return $this;
  244. }
  245. }