src/VendorBundle/Entity/StoreAddress.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\VendorBundle\Entity;
  3. use App\NewShippingBundle\Entity\Zone;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use PN\ServiceBundle\Interfaces\DateTimeInterface;
  6. use PN\ServiceBundle\Model\DateTimeTrait;
  7. use PN\ServiceBundle\Model\VirtualDeleteTrait;
  8. /**
  9. * @ORM\Table("store_address")
  10. * @ORM\Entity(repositoryClass="App\VendorBundle\Repository\StoreAddressRepository")
  11. */
  12. class StoreAddress implements DateTimeInterface
  13. {
  14. use VirtualDeleteTrait,
  15. DateTimeTrait;
  16. /**
  17. * @ORM\Column(name="id", type="integer")
  18. * @ORM\Id
  19. * @ORM\GeneratedValue(strategy="AUTO")
  20. */
  21. private ?int $id = null;
  22. /**
  23. * @ORM\ManyToOne(targetEntity="App\NewShippingBundle\Entity\Zone")
  24. */
  25. private ?Zone $zone = null;
  26. /**
  27. * @ORM\ManyToOne(targetEntity="App\VendorBundle\Entity\Vendor", inversedBy="storeAddresses")
  28. */
  29. private ?Vendor $vendor = null;
  30. /**
  31. * @ORM\Column(name="title", type="string", length=45, nullable=true)
  32. */
  33. private ?string $title = null;
  34. /**
  35. * @ORM\Column(name="street_name", type="string", length=500, nullable=true)
  36. */
  37. private ?string $streetName = null;
  38. /**
  39. * @ORM\Column(name="land_mark", type="string", length=255, nullable=true)
  40. */
  41. private ?string $landMark = null;
  42. /**
  43. * international vendor
  44. * @ORM\Column(name="town", type="string", length=255, nullable=true)
  45. */
  46. private ?string $town = null;
  47. /**
  48. * City in international vendor
  49. * @ORM\Column(name="area", type="string", length=50, nullable=true)
  50. */
  51. private ?string $area = null;
  52. /**
  53. * @ORM\Column(name="floor", type="string", length=100, nullable=true)
  54. */
  55. private ?string $floor = null;
  56. /**
  57. * @ORM\Column(name="apartment", type="string", length=5, nullable=true)
  58. */
  59. private ?string $apartment = null;
  60. /**
  61. * @ORM\Column(name="postal_code", type="string", length=10, nullable=true)
  62. */
  63. private ?string $postalCode = null;
  64. /**
  65. * @ORM\Column(name="mobile_number", type="string", length=20)
  66. */
  67. private ?string $mobileNumber = null;
  68. /**
  69. * @ORM\Column(name="full_address", type="text", nullable=true)
  70. */
  71. private ?string $fullAddress;
  72. public function __toString()
  73. {
  74. $title = null;
  75. if ($this->getTitle()) {
  76. $title = $this->getTitle() . " - ";
  77. }
  78. $title .= $this->getFullAddress();
  79. return $title;
  80. }
  81. public function getFullAddress(): ?string
  82. {
  83. if ($this->fullAddress != null) {
  84. return $this->fullAddress;
  85. }
  86. $fullAddress = null;
  87. if ($this->getApartment() != null) {
  88. $fullAddress .= $this->getApartment() . ' ';
  89. }
  90. if ($this->getStreetName() != null) {
  91. $fullAddress .= $this->getStreetName() . ', ';
  92. }
  93. if ($this->getTown() != null) {
  94. $fullAddress .= $this->getTown() . ', ';
  95. }
  96. if ($this->getArea() != null) {
  97. $fullAddress .= $this->getArea() . ', ';
  98. }
  99. if ($this->getZone() != null) {
  100. $fullAddress .= $this->getZone() . ', ';
  101. }
  102. if ($this->getPostalCode() != null) {
  103. $fullAddress .= "#" . $this->getPostalCode();
  104. }
  105. if ($fullAddress) {
  106. return $fullAddress;
  107. }
  108. return null;
  109. }
  110. public function getId(): ?int
  111. {
  112. return $this->id;
  113. }
  114. public function getTitle(): ?string
  115. {
  116. return $this->title;
  117. }
  118. public function setTitle(?string $title): static
  119. {
  120. $this->title = $title;
  121. return $this;
  122. }
  123. public function getStreetName(): ?string
  124. {
  125. return $this->streetName;
  126. }
  127. public function setStreetName(?string $streetName): static
  128. {
  129. $this->streetName = $streetName;
  130. return $this;
  131. }
  132. public function getLandMark(): ?string
  133. {
  134. return $this->landMark;
  135. }
  136. public function setLandMark(?string $landMark): static
  137. {
  138. $this->landMark = $landMark;
  139. return $this;
  140. }
  141. public function getTown(): ?string
  142. {
  143. return $this->town;
  144. }
  145. public function setTown(?string $town): static
  146. {
  147. $this->town = $town;
  148. return $this;
  149. }
  150. public function getArea(): ?string
  151. {
  152. return $this->area;
  153. }
  154. public function setArea(?string $area): static
  155. {
  156. $this->area = $area;
  157. return $this;
  158. }
  159. public function getFloor(): ?string
  160. {
  161. return $this->floor;
  162. }
  163. public function setFloor(?string $floor): static
  164. {
  165. $this->floor = $floor;
  166. return $this;
  167. }
  168. public function getApartment(): ?string
  169. {
  170. return $this->apartment;
  171. }
  172. public function setApartment(?string $apartment): static
  173. {
  174. $this->apartment = $apartment;
  175. return $this;
  176. }
  177. public function getPostalCode(): ?string
  178. {
  179. return $this->postalCode;
  180. }
  181. public function setPostalCode(?string $postalCode): static
  182. {
  183. $this->postalCode = $postalCode;
  184. return $this;
  185. }
  186. public function getMobileNumber(): ?string
  187. {
  188. return $this->mobileNumber;
  189. }
  190. public function setMobileNumber(string $mobileNumber): static
  191. {
  192. $this->mobileNumber = $mobileNumber;
  193. return $this;
  194. }
  195. public function setFullAddress(?string $fullAddress): static
  196. {
  197. $this->fullAddress = $fullAddress;
  198. return $this;
  199. }
  200. public function getVendor(): ?Vendor
  201. {
  202. return $this->vendor;
  203. }
  204. public function setVendor(?Vendor $vendor): static
  205. {
  206. $this->vendor = $vendor;
  207. return $this;
  208. }
  209. public function getZone(): ?Zone
  210. {
  211. return $this->zone;
  212. }
  213. public function setZone(?Zone $zone): static
  214. {
  215. $this->zone = $zone;
  216. return $this;
  217. }
  218. }