src/Entity/Station.php line 21

Open in your IDE?
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: parcel
  5. * Date: 8/24/18
  6. * Time: 7:45 PM
  7. */
  8. namespace App\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use JMS\Serializer\Annotation as Serializer;
  11. use Symfony\Component\Serializer\Annotation\Ignore;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. /**
  14. * @ORM\Entity(repositoryClass="App\Repository\StationRepository")
  15. * @ORM\Table(name="station")
  16. */
  17. class Station {
  18. /**
  19. * @ORM\Id
  20. * @ORM\GeneratedValue(strategy="IDENTITY")
  21. * @ORM\Column(type="integer")
  22. */
  23. private $id;
  24. /**
  25. * @Assert\NotBlank(message="Please Enter the station name")
  26. * @ORM\Column(type="string")
  27. */
  28. private $stationName;
  29. /**
  30. * @Assert\NotBlank(message="Please Enter the station name")
  31. * @ORM\Column(type="text")
  32. */
  33. private $stationAddress;
  34. //@Assert\NotBlank(message="Please Enter the phone numbers")
  35. /**
  36. * @ORM\Column(type="text", nullable=true)
  37. */
  38. private $phone_numbers;
  39. /**
  40. * @Ignore
  41. * @var \App\Entity\Organization
  42. * @Serializer\Type("App\Entity\Organization")
  43. * @ORM\ManyToOne(targetEntity="App\Entity\Organization")
  44. * @ORM\JoinColumns({
  45. * @ORM\JoinColumn(name="organization_id", referencedColumnName="id")
  46. * })
  47. */
  48. private $organization;
  49. /**
  50. * @Serializer\Type("DateTime<'d/m/Y'>")
  51. * @ORM\Column(type="datetime")
  52. */
  53. private $createdAt;
  54. /**
  55. * @ORM\Column(type="string")
  56. */
  57. private $operatingHrs;
  58. /**
  59. * @Ignore
  60. * @var User
  61. * @Serializer\Type("App\Entity\User")
  62. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  63. * @ORM\JoinColumns({
  64. * @ORM\JoinColumn(name="created_by", referencedColumnName="id")
  65. * })
  66. */
  67. private $createdBy;
  68. /**
  69. * @ORM\Column(type="boolean")
  70. */
  71. private $isMobile;
  72. /**
  73. * @return mixed
  74. */
  75. public function getId()
  76. {
  77. return $this->id;
  78. }
  79. /**
  80. * @param mixed $id
  81. */
  82. public function setId($id)
  83. {
  84. $this->id = $id;
  85. }
  86. /**
  87. * @return mixed
  88. */
  89. public function getStationName()
  90. {
  91. return $this->stationName;
  92. }
  93. /**
  94. * @param mixed $stationName
  95. */
  96. public function setStationName($stationName)
  97. {
  98. $this->stationName = $stationName;
  99. }
  100. /**
  101. * @return mixed
  102. */
  103. public function getStationAddress()
  104. {
  105. return $this->stationAddress;
  106. }
  107. /**
  108. * @param mixed $stationAddress
  109. */
  110. public function setStationAddress($stationAddress)
  111. {
  112. $this->stationAddress = $stationAddress;
  113. }
  114. /**
  115. * @return mixed
  116. */
  117. public function getPhoneNumbers()
  118. {
  119. return $this->phone_numbers;
  120. }
  121. /**
  122. * @param mixed $phone_numbers
  123. */
  124. public function setPhoneNumbers($phone_numbers)
  125. {
  126. $this->phone_numbers = $phone_numbers;
  127. }
  128. /**
  129. * @return Organization
  130. */
  131. public function getOrganization()
  132. {
  133. return $this->organization;
  134. }
  135. /**
  136. * @param Organization $organization
  137. */
  138. public function setOrganization($organization)
  139. {
  140. $this->organization = $organization;
  141. }
  142. /**
  143. * @return mixed
  144. */
  145. public function getCreatedAt()
  146. {
  147. return $this->createdAt;
  148. }
  149. /**
  150. * @param mixed $createdAt
  151. */
  152. public function setCreatedAt($createdAt)
  153. {
  154. $this->createdAt = $createdAt;
  155. }
  156. /**
  157. * @return User
  158. */
  159. public function getCreatedBy()
  160. {
  161. return $this->createdBy;
  162. }
  163. /**
  164. * @param User $createdBy
  165. */
  166. public function setCreatedBy($createdBy)
  167. {
  168. $this->createdBy = $createdBy;
  169. }
  170. /**
  171. * @return mixed
  172. */
  173. public function getOperatingHrs()
  174. {
  175. return $this->operatingHrs;
  176. }
  177. /**
  178. * @param mixed $operatingHrs
  179. */
  180. public function setOperatingHrs($operatingHrs): void
  181. {
  182. $this->operatingHrs = $operatingHrs;
  183. }
  184. /**
  185. * @return mixed
  186. */
  187. public function getIsMobile()
  188. {
  189. return $this->isMobile;
  190. }
  191. /**
  192. * @param mixed $isMobile
  193. */
  194. public function setIsMobile(mixed $isMobile): void
  195. {
  196. $this->isMobile = $isMobile;
  197. }
  198. public function __toString()
  199. {
  200. // TODO: Implement __toString() method.
  201. return $this->stationName;
  202. }
  203. }