1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/tests/Doctrine/Tests/Models/CMS/CmsGroup.php

50 lines
806 B
PHP
Raw Normal View History

<?php
2011-12-20 01:56:19 +04: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
* @Entity
* @Table(name="cms_groups")
*/
class CmsGroup
{
/**
* @Id
* @Column(type="integer")
2010-04-10 02:00:36 +04:00
* @GeneratedValue
*/
public $id;
/**
2010-04-10 02:00:36 +04:00
* @Column(length=50)
*/
public $name;
/**
* @ManyToMany(targetEntity="CmsUser", mappedBy="groups")
*/
public $users;
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function addUser(CmsUser $user) {
$this->users[] = $user;
}
public function getUsers() {
return $this->users;
}
}