src/AdminBundle/Entity/Tours.php line 13

Open in your IDE?
  1. <?php
  2. namespace AdminBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * Tours
  7. */
  8. #[ORM\Table(name: 'tours')]
  9. #[ORM\Entity(repositoryClass: \AdminBundle\Repository\ToursRepository::class)]
  10. class Tours
  11. {
  12. /**
  13. * @var int
  14. */
  15. #[ORM\Column(name: 'id', type: 'integer')]
  16. #[ORM\Id]
  17. #[ORM\GeneratedValue(strategy: 'AUTO')]
  18. private $id;
  19. /**
  20. * @var string
  21. */
  22. #[ORM\Column(name: 'name', type: 'string', length: 255)]
  23. private $name;
  24. /**
  25. * @var \DateTime
  26. */
  27. #[ORM\Column(name: 'createdDate', type: 'datetime', nullable: true)]
  28. private $createdDate;
  29. /**
  30. * @var string
  31. */
  32. #[ORM\Column(name: 'description', type: 'text', length: 4294967295, nullable: true)]
  33. private $description;
  34. /**
  35. * @var Images
  36. */
  37. #[ORM\JoinColumn(name: 'image', referencedColumnName: 'id')]
  38. #[ORM\OneToOne(targetEntity: \Images::class, inversedBy: 'tour')]
  39. protected $image;
  40. #[ORM\JoinTable(name: 'tours_objectives')]
  41. #[ORM\ManyToMany(targetEntity: \Objectives::class, inversedBy: 'tours')]
  42. private $objectives;
  43. #[ORM\JoinTable(name: 'tours_start_points')]
  44. #[ORM\ManyToMany(targetEntity: \Locations::class, inversedBy: 'toursStarts')]
  45. private $startPoints;
  46. #[ORM\JoinTable(name: 'tours_end_points')]
  47. #[ORM\ManyToMany(targetEntity: \Locations::class, inversedBy: 'toursEnds')]
  48. private $endPoints;
  49. /**
  50. * Constructor
  51. */
  52. public function __construct()
  53. {
  54. $this->objectives = new ArrayCollection();
  55. $this->startPoints = new ArrayCollection();
  56. $this->endPoints = new ArrayCollection();
  57. }
  58. public function __toString() {
  59. return $this->getId() ? $this->getName() : 'n\a';
  60. }
  61. /**
  62. * Get id
  63. *
  64. * @return int
  65. */
  66. public function getId()
  67. {
  68. return $this->id;
  69. }
  70. /**
  71. * Set name
  72. *
  73. * @param string $name
  74. *
  75. * @return Tours
  76. */
  77. public function setName($name)
  78. {
  79. $this->name = $name;
  80. return $this;
  81. }
  82. /**
  83. * Get name
  84. *
  85. * @return string
  86. */
  87. public function getName()
  88. {
  89. return $this->name;
  90. }
  91. /**
  92. * Set createdDate
  93. *
  94. * @param \DateTime $createdDate
  95. *
  96. * @return Tours
  97. */
  98. public function setCreatedDate($createdDate)
  99. {
  100. $this->createdDate = $createdDate;
  101. return $this;
  102. }
  103. /**
  104. * Get createdDate
  105. *
  106. * @return \DateTime
  107. */
  108. public function getCreatedDate()
  109. {
  110. return $this->createdDate;
  111. }
  112. /**
  113. * Set description
  114. *
  115. * @param string $description
  116. *
  117. * @return Tours
  118. */
  119. public function setDescription($description)
  120. {
  121. $this->description = $description;
  122. return $this;
  123. }
  124. /**
  125. * Get description
  126. *
  127. * @return string
  128. */
  129. public function getDescription()
  130. {
  131. return $this->description;
  132. }
  133. /**
  134. * @return Images
  135. */
  136. public function getImage()
  137. {
  138. return $this->image;
  139. }
  140. /**
  141. * @param Images $image
  142. */
  143. public function setImage($image)
  144. {
  145. $this->image = $image;
  146. }
  147. /**
  148. * Add objective
  149. *
  150. * @param \AdminBundle\Entity\Objectives $objective
  151. *
  152. * @return Tours
  153. */
  154. public function addObjective(Objectives $objective)
  155. {
  156. $this->objectives[] = $objective;
  157. return $this;
  158. }
  159. /**
  160. * Remove objective
  161. *
  162. * @param \AdminBundle\Entity\Objectives $objective
  163. */
  164. public function removeObjective(Objectives $objective)
  165. {
  166. $this->objectives->removeElement($objective);
  167. }
  168. /**
  169. * Get objectives
  170. *
  171. * @return \Doctrine\Common\Collections\Collection
  172. */
  173. public function getObjectives()
  174. {
  175. return $this->objectives;
  176. }
  177. /**
  178. * Add startPoint
  179. *
  180. * @param \AdminBundle\Entity\Locations $startPoint
  181. *
  182. * @return Tours
  183. */
  184. public function addStartPoint(Locations $startPoint)
  185. {
  186. $this->startPoints[] = $startPoint;
  187. return $this;
  188. }
  189. /**
  190. * Remove startPoint
  191. *
  192. * @param \AdminBundle\Entity\Locations $startPoint
  193. */
  194. public function removeStartPoint(Locations $startPoint)
  195. {
  196. $this->startPoints->removeElement($startPoint);
  197. }
  198. /**
  199. * Get startPoints
  200. *
  201. * @return \Doctrine\Common\Collections\Collection
  202. */
  203. public function getStartPoints()
  204. {
  205. return $this->startPoints;
  206. }
  207. /**
  208. * Add endPoint
  209. *
  210. * @param \AdminBundle\Entity\Locations $endPoint
  211. *
  212. * @return Tours
  213. */
  214. public function addEndPoint(Locations $endPoint)
  215. {
  216. $this->endPoints[] = $endPoint;
  217. return $this;
  218. }
  219. /**
  220. * Remove endPoint
  221. *
  222. * @param \AdminBundle\Entity\Locations $endPoint
  223. */
  224. public function removeEndPoint(Locations $endPoint)
  225. {
  226. $this->endPoints->removeElement($endPoint);
  227. }
  228. /**
  229. * Get endPoints
  230. *
  231. * @return \Doctrine\Common\Collections\Collection
  232. */
  233. public function getEndPoints()
  234. {
  235. return $this->endPoints;
  236. }
  237. }