Adde name source to user

This commit is contained in:
Kevin Frantz
2018-09-14 14:39:47 +02:00
parent bfd5d9416e
commit 1d7aaeb1dd
10 changed files with 82 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Attribut\UserAttribut;
use App\Entity\Attribut\NameSourceAttribut;
/**
* @author kevinfrantz
@@ -12,13 +13,27 @@ use App\Entity\Attribut\UserAttribut;
*/
class UserSource extends AbstractSource implements UserSourceInterface
{
use UserAttribut;
use UserAttribut,NameSourceAttribut;
/**
* @ORM\OneToOne(targetEntity="User")
* @ORM\OneToOne(targetEntity="User",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*
* @var User
*/
protected $user;
/**
* @ORM\OneToOne(targetEntity="NameSource",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="name_id", referencedColumnName="id")
*
* @var NameSourceInterface
*/
protected $nameSource;
public function __construct()
{
$this->nameSource = new NameSource();
parent::__construct();
}
}