1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/tests/Doctrine/Tests/Models/DDC964/DDC964Group.php

71 lines
1.0 KiB
PHP
Raw Normal View History

2011-12-14 22:28:01 +04:00
<?php
namespace Doctrine\Tests\Models\DDC964;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @Entity
*/
class DDC964Group
{
/**
* @GeneratedValue
* @Id @Column(type="integer")
*/
private $id;
/**
* @Column
*/
private $name;
/**
* @ArrayCollection
*
* @ManyToMany(targetEntity="DDC964User", mappedBy="groups")
*/
private $users;
public function __construct($name = null)
{
$this->name = $name;
$this->users = new ArrayCollection();
}
/**
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param DDC964User $user
*/
public function addUser(DDC964User $user)
{
$this->users[] = $user;
}
/**
* @return ArrayCollection
*/
public function getUsers()
{
return $this->users;
}
}