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