CmsGroup.php 839 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Doctrine\Tests\Models\CMS;

/**
 * Description of CmsGroup
 *
 * @author robo
13 14
 * @Entity
 * @Table(name="cms_groups")
15 16 17 18
 */
class CmsGroup
{
    /**
19 20
     * @Id
     * @Column(type="integer")
21
     * @GeneratedValue(strategy="AUTO")
22 23 24
     */
    public $id;
    /**
25
     * @Column(type="string", length=50)
26 27 28
     */
    public $name;
    /**
29
     * @ManyToMany(targetEntity="CmsUser", mappedBy="groups")
30 31
     */
    public $users;
32 33 34 35 36 37 38 39 40 41 42 43

    public function setName($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }

    public function addUser(CmsUser $user) {
        $this->users[] = $user;
    }
44 45 46 47

    public function getUsers() {
        return $this->users;
    }
48 49
}