Added draft for Identity and Names

This commit is contained in:
Kevin Frantz
2018-11-10 17:25:48 +01:00
parent a06422a1c4
commit 7a6a5e1bcf
15 changed files with 129 additions and 15 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Entity\Source\Data;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\Attribut\UserAttribut;
use App\Entity\Attribut\NameSourceAttribut;
use App\Entity\UserInterface;
/**
* @author kevinfrantz
* @ORM\Table(name="source_data_user")
* @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository")
*/
class UserSource extends AbstractDataSource implements UserSourceInterface
{
use UserAttribut,NameSourceAttribut;
/**
* @ORM\OneToOne(targetEntity="App\Entity\User",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*
* @var UserInterface
*/
protected $user;
/**
* @Assert\Type(type="App\Entity\Source\NameSource")
* @Assert\Valid()
* @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();
}
}