Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / CMS / CmsGroup.php
1 <?php
2 /*
3  * To change this template, choose Tools | Templates
4  * and open the template in the editor.
5  */
6
7 namespace Doctrine\Tests\Models\CMS;
8
9 /**
10  * Description of CmsGroup
11  *
12  * @author robo
13  * @Entity
14  * @Table(name="cms_groups")
15  */
16 class CmsGroup
17 {
18     /**
19      * @Id
20      * @Column(type="integer")
21      * @GeneratedValue
22      */
23     public $id;
24     /**
25      * @Column(length=50)
26      */
27     public $name;
28     /**
29      * @ManyToMany(targetEntity="CmsUser", mappedBy="groups")
30      */
31     public $users;
32
33     public function setName($name) {
34         $this->name = $name;
35     }
36
37     public function getName() {
38         return $this->name;
39     }
40
41     public function addUser(CmsUser $user) {
42         $this->users[] = $user;
43     }
44
45     public function getUsers() {
46         return $this->users;
47     }
48 }
49