2009-02-04 16:35:36 +00:00
|
|
|
<?php
|
2011-12-19 22:56:19 +01:00
|
|
|
/*
|
2009-02-04 16:35:36 +00:00
|
|
|
* 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 10:23:13 +00:00
|
|
|
* @Entity
|
|
|
|
* @Table(name="cms_groups")
|
2009-02-04 16:35:36 +00:00
|
|
|
*/
|
|
|
|
class CmsGroup
|
|
|
|
{
|
|
|
|
/**
|
2009-05-29 10:23:13 +00:00
|
|
|
* @Id
|
|
|
|
* @Column(type="integer")
|
2010-04-10 00:00:36 +02:00
|
|
|
* @GeneratedValue
|
2009-02-04 16:35:36 +00:00
|
|
|
*/
|
|
|
|
public $id;
|
|
|
|
/**
|
2010-04-10 00:00:36 +02:00
|
|
|
* @Column(length=50)
|
2009-02-04 16:35:36 +00:00
|
|
|
*/
|
|
|
|
public $name;
|
|
|
|
/**
|
2009-05-29 10:23:13 +00:00
|
|
|
* @ManyToMany(targetEntity="CmsUser", mappedBy="groups")
|
2009-02-04 16:35:36 +00:00
|
|
|
*/
|
|
|
|
public $users;
|
2009-05-07 13:54:01 +00: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 16:36:27 +00:00
|
|
|
|
|
|
|
public function getUsers() {
|
|
|
|
return $this->users;
|
|
|
|
}
|
2009-02-04 16:35:36 +00:00
|
|
|
}
|
|
|
|
|