Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / DDC964 / DDC964Group.php
1 <?php
2
3 namespace Doctrine\Tests\Models\DDC964;
4
5 use Doctrine\Common\Collections\ArrayCollection;
6
7 /**
8  * @Entity
9  */
10 class DDC964Group
11 {
12
13     /**
14      * @GeneratedValue
15      * @Id @Column(type="integer")
16      */
17     private $id;
18
19     /**
20      * @Column
21      */
22     private $name;
23
24     /**
25      * @ArrayCollection
26      * 
27      * @ManyToMany(targetEntity="DDC964User", mappedBy="groups")
28      */
29     private $users;
30
31     public function __construct($name = null)
32     {
33         $this->name = $name;
34         $this->users = new ArrayCollection();
35     }
36
37     /**
38      * @param string $name
39      */
40     public function setName($name)
41     {
42         $this->name = $name;
43     }
44
45     /**
46      * @return string
47      */
48     public function getName()
49     {
50         return $this->name;
51     }
52
53     /**
54      * @param DDC964User $user
55      */
56     public function addUser(DDC964User $user)
57     {
58         $this->users[] = $user;
59     }
60
61     /**
62      * @return ArrayCollection
63      */
64     public function getUsers()
65     {
66         return $this->users;
67     }
68
69 }
70