2009-02-04 19:35:36 +03:00
|
|
|
<?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
|
2009-05-29 14:23:13 +04:00
|
|
|
* @Entity
|
|
|
|
* @Table(name="cms_groups")
|
2009-02-04 19:35:36 +03:00
|
|
|
*/
|
|
|
|
class CmsGroup
|
|
|
|
{
|
|
|
|
/**
|
2009-05-29 14:23:13 +04:00
|
|
|
* @Id
|
|
|
|
* @Column(type="integer")
|
|
|
|
* @GeneratedValue(strategy="auto")
|
2009-02-04 19:35:36 +03:00
|
|
|
*/
|
|
|
|
public $id;
|
|
|
|
/**
|
2009-05-29 14:23:13 +04:00
|
|
|
* @Column(type="string", length=50)
|
2009-02-04 19:35:36 +03:00
|
|
|
*/
|
|
|
|
public $name;
|
|
|
|
/**
|
2009-05-29 14:23:13 +04:00
|
|
|
* @ManyToMany(targetEntity="CmsUser", mappedBy="groups")
|
2009-02-04 19:35:36 +03:00
|
|
|
*/
|
|
|
|
public $users;
|
2009-05-07 17:54:01 +04:00
|
|
|
|
|
|
|
public function setName($name) {
|
|
|
|
$this->name = $name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function addUser(CmsUser $user) {
|
|
|
|
$this->users[] = $user;
|
|
|
|
}
|
2009-05-07 20:36:27 +04:00
|
|
|
|
|
|
|
public function getUsers() {
|
|
|
|
return $this->users;
|
|
|
|
}
|
2009-02-04 19:35:36 +03:00
|
|
|
}
|
|
|
|
|