mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Added draft for Identity and Names
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Combination;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
abstract class AbstractCombinationSource extends AbstractSource implements CombinationSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Combination;
|
||||
|
||||
use App\Entity\Source\Data\DataSourceInterface;
|
||||
|
||||
interface CombinationSourceInterface extends DataSourceInterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Combination;
|
||||
|
||||
use App\Entity\Source\Data\Name\FirstNameSourceInterface;
|
||||
use App\Entity\Source\Data\Name\SurnameSourceInterface;
|
||||
|
||||
/**
|
||||
* @todo Maybe a middle name would be helpfull in the future ;)
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface FullPersonNameSourceInterface extends CombinationSourceInterface
|
||||
{
|
||||
public function getFirstName():FirstNameSourceInterface;
|
||||
|
||||
public function setFirstName(FirstNameSourceInterface $name):void;
|
||||
|
||||
public function getSurname():SurnameSourceInterface;
|
||||
|
||||
public function setSurname(SurnameSourceInterface $name):void;
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Data;
|
||||
|
||||
use App\Entity\Attribut\NameAttributInterface;
|
||||
|
||||
interface IdentityInterface extends DataSourceInterface, NameAttributInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Data;
|
||||
|
||||
class IdentitySource extends AbstractDataSource implements IdentityInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
43
application/src/Entity/Source/Combination/UserSource.php
Normal file
43
application/src/Entity/Source/Combination/UserSource.php
Normal 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();
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Data;
|
||||
|
||||
use App\Entity\Attribut\UserAttributInterface;
|
||||
use App\Entity\Attribut\NameSourceAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface UserSourceInterface extends DataSourceInterface, UserAttributInterface, NameSourceAttributInterface
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user