NavTour.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Doctrine\Tests\Models\Navigation;
  3. /**
  4. * @Entity
  5. * @Table(name="navigation_tours")
  6. */
  7. class NavTour
  8. {
  9. /**
  10. * @Id
  11. * @Column(type="integer")
  12. * @generatedValue
  13. */
  14. private $id;
  15. /**
  16. * @column(type="string")
  17. */
  18. private $name;
  19. /**
  20. * @ManyToMany(targetEntity="NavPointOfInterest")
  21. * @JoinTable(name="navigation_tour_pois",
  22. * joinColumns={@JoinColumn(name="tour_id", referencedColumnName="id")},
  23. * inverseJoinColumns={
  24. * @JoinColumn(name="poi_long", referencedColumnName="nav_long"),
  25. * @JoinColumn(name="poi_lat", referencedColumnName="nav_lat")
  26. * }
  27. * )
  28. *
  29. */
  30. private $pois;
  31. public function __construct($name)
  32. {
  33. $this->name = $name;
  34. $this->pois = new \Doctrine\Common\Collections\ArrayCollection;
  35. }
  36. public function addPointOfInterest(NavPointOfInterest $poi)
  37. {
  38. $this->pois[] = $poi;
  39. }
  40. public function getPointOfInterests()
  41. {
  42. return $this->pois;
  43. }
  44. public function getName()
  45. {
  46. return $this->name;
  47. }
  48. public function getId()
  49. {
  50. return $this->id;
  51. }
  52. }