2012-06-04 23:56:46 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\Quote;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
* @Table(name="`quote-group`")
|
|
|
|
*/
|
|
|
|
class Group
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Id
|
|
|
|
* @GeneratedValue
|
|
|
|
* @Column(type="integer", name="`group-id`")
|
|
|
|
*/
|
|
|
|
public $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Column(name="`group-name`")
|
|
|
|
*/
|
|
|
|
public $name;
|
|
|
|
|
2012-06-06 00:10:44 +04:00
|
|
|
/**
|
|
|
|
* @ManyToOne(targetEntity="Group", cascade={"persist"})
|
|
|
|
* @JoinColumn(name="`parent-id`", referencedColumnName="`group-id`")
|
|
|
|
*/
|
|
|
|
public $parent;
|
|
|
|
|
2012-06-04 23:56:46 +04:00
|
|
|
/**
|
|
|
|
* @ManyToMany(targetEntity="User", mappedBy="groups")
|
|
|
|
*/
|
|
|
|
public $users;
|
|
|
|
|
2012-06-06 00:10:44 +04:00
|
|
|
public function __construct($name = null, Group $parent = null)
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
$this->parent = $parent;
|
|
|
|
}
|
2012-06-04 23:56:46 +04:00
|
|
|
}
|