1
0
mirror of synced 2025-02-14 03:03:15 +03:00
2014-01-02 23:07:53 +01:00

41 lines
816 B
PHP

<?php
namespace Doctrine\Tests\Models\DDC2775;
/** @Entity */
class User
{
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @OneToMany(targetEntity="Role", mappedBy="user", cascade={"all"}, orphanRemoval=true)
*/
public $roles;
/**
* @OneToMany(targetEntity="Authorization", mappedBy="user", cascade={"all"}, orphanRemoval=true)
*/
public $authorizations;
public function getId()
{
return $this->id;
}
public function addRole(Role $role)
{
$this->roles[] = $role;
$role->setUser($this);
}
public function addAuthorization(Authorization $authorization)
{
$this->authorizations[] = $authorization;
$authorization->setUser($this);
}
}