src/Entity/Station.php line 20

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