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. /**
  59. * Get id
  60. *
  61. * @return int
  62. */
  63. public function getId()
  64. {
  65. return $this->id;
  66. }
  67. /**
  68. * Set name
  69. *
  70. * @param string $name
  71. *
  72. * @return Tours
  73. */
  74. public function setName($name)
  75. {
  76. $this->name = $name;
  77. return $this;
  78. }
  79. /**
  80. * Get name
  81. *
  82. * @return string
  83. */
  84. public function getName()
  85. {
  86. return $this->name;
  87. }
  88. /**
  89. * Set createdDate
  90. *
  91. * @param \DateTime $createdDate
  92. *
  93. * @return Tours
  94. */
  95. public function setCreatedDate($createdDate)
  96. {
  97. $this->createdDate = $createdDate;
  98. return $this;
  99. }
  100. /**
  101. * Get createdDate
  102. *
  103. * @return \DateTime
  104. */
  105. public function getCreatedDate()
  106. {
  107. return $this->createdDate;
  108. }
  109. /**
  110. * Set description
  111. *
  112. * @param string $description
  113. *
  114. * @return Tours
  115. */
  116. public function setDescription($description)
  117. {
  118. $this->description = $description;
  119. return $this;
  120. }
  121. /**
  122. * Get description
  123. *
  124. * @return string
  125. */
  126. public function getDescription()
  127. {
  128. return $this->description;
  129. }
  130. /**
  131. * @return Images
  132. */
  133. public function getImage()
  134. {
  135. return $this->image;
  136. }
  137. /**
  138. * @param Images $image
  139. */
  140. public function setImage($image)
  141. {
  142. $this->image = $image;
  143. }
  144. /**
  145. * Add objective
  146. *
  147. * @param \AdminBundle\Entity\Objectives $objective
  148. *
  149. * @return Tours
  150. */
  151. public function addObjective(Objectives $objective)
  152. {
  153. $this->objectives[] = $objective;
  154. return $this;
  155. }
  156. /**
  157. * Remove objective
  158. *
  159. * @param \AdminBundle\Entity\Objectives $objective
  160. */
  161. public function removeObjective(Objectives $objective)
  162. {
  163. $this->objectives->removeElement($objective);
  164. }
  165. /**
  166. * Get objectives
  167. *
  168. * @return \Doctrine\Common\Collections\Collection
  169. */
  170. public function getObjectives()
  171. {
  172. return $this->objectives;
  173. }
  174. /**
  175. * Add startPoint
  176. *
  177. * @param \AdminBundle\Entity\Locations $startPoint
  178. *
  179. * @return Tours
  180. */
  181. public function addStartPoint(Locations $startPoint)
  182. {
  183. $this->startPoints[] = $startPoint;
  184. return $this;
  185. }
  186. /**
  187. * Remove startPoint
  188. *
  189. * @param \AdminBundle\Entity\Locations $startPoint
  190. */
  191. public function removeStartPoint(Locations $startPoint)
  192. {
  193. $this->startPoints->removeElement($startPoint);
  194. }
  195. /**
  196. * Get startPoints
  197. *
  198. * @return \Doctrine\Common\Collections\Collection
  199. */
  200. public function getStartPoints()
  201. {
  202. return $this->startPoints;
  203. }
  204. /**
  205. * Add endPoint
  206. *
  207. * @param \AdminBundle\Entity\Locations $endPoint
  208. *
  209. * @return Tours
  210. */
  211. public function addEndPoint(Locations $endPoint)
  212. {
  213. $this->endPoints[] = $endPoint;
  214. return $this;
  215. }
  216. /**
  217. * Remove endPoint
  218. *
  219. * @param \AdminBundle\Entity\Locations $endPoint
  220. */
  221. public function removeEndPoint(Locations $endPoint)
  222. {
  223. $this->endPoints->removeElement($endPoint);
  224. }
  225. /**
  226. * Get endPoints
  227. *
  228. * @return \Doctrine\Common\Collections\Collection
  229. */
  230. public function getEndPoints()
  231. {
  232. return $this->endPoints;
  233. }
  234. }