mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Changed combination to complex
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="source_combination")
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({"user" = "UserSource","fullpersonname" = "FullPersonNameSource","personidentitysource"="PersonIdentitySource","fullpersonnamesource"="FullPersonNameSource"})
|
||||
*/
|
||||
abstract class AbstractCombinationSource extends AbstractSource implements CombinationSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Source\Primitive\DataSourceInterface;
|
||||
|
||||
interface CombinationSourceInterface extends DataSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FirstNameSourceAttribut;
|
||||
use App\Entity\Attribut\SurnameSourceAttribut;
|
||||
use App\Entity\Source\Primitive\Name\SurnameSource;
|
||||
use App\Entity\Source\Primitive\Name\FirstNameSource;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Source\Primitive\Name\SurnameSourceInterface;
|
||||
use App\Entity\Source\Primitive\Name\FirstNameSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_combination_fullpersonname")
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class FullPersonNameSource extends AbstractCombinationSource implements FullPersonNameSourceInterface
|
||||
{
|
||||
use FirstNameSourceAttribut,SurnameSourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Primitive\Name\SurnameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="surname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var SurnameSourceInterface
|
||||
*/
|
||||
protected $surnameSource;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Primitive\Name\FirstNameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="firstname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var FirstNameSourceInterface
|
||||
*/
|
||||
protected $firstNameSource;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->surnameSource = new SurnameSource();
|
||||
$this->firstNameSource = new FirstNameSource();
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FirstNameSourceAttributInterface;
|
||||
use App\Entity\Attribut\SurnameSourceAttributInterface;
|
||||
|
||||
/**
|
||||
* @todo Maybe a middle name would be helpfull in the future ;)
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface FullPersonNameSourceInterface extends CombinationSourceInterface, FirstNameSourceAttributInterface, SurnameSourceAttributInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FullPersonNameSourceAttribut;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_combination_person_identity")
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class PersonIdentitySource extends AbstractCombinationSource implements PersonIdentitySourceInterface
|
||||
{
|
||||
use FullPersonNameSourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="FullPersonNameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="fullname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var FullPersonNameSourceInterface
|
||||
*/
|
||||
protected $fullPersonNameSource;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->fullPersonNameSource = new FullPersonNameSource();
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FullPersonNameSourceAttributInterface;
|
||||
|
||||
interface PersonIdentitySourceInterface extends CombinationSourceInterface, FullPersonNameSourceAttributInterface
|
||||
{
|
||||
}
|
40
application/src/Entity/Source/Complex/UserSource.php
Normal file
40
application/src/Entity/Source/Complex/UserSource.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Attribut\UserAttribut;
|
||||
use App\Entity\UserInterface;
|
||||
use App\Entity\Attribut\PersonIdentitySourceAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_data_user")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository")
|
||||
*/
|
||||
class UserSource extends AbstractCombinationSource implements UserSourceInterface
|
||||
{
|
||||
use UserAttribut,PersonIdentitySourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\User",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="PersonIdentitySource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="identity_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var PersonIdentitySourceInterface
|
||||
*/
|
||||
protected $personIdentitySource;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->personIdentitySource = new PersonIdentitySource();
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\UserAttributInterface;
|
||||
use App\Entity\Attribut\PersonIdentitySourceAttributInterface;
|
||||
use App\Entity\Source\Primitive\DataSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface UserSourceInterface extends DataSourceInterface, UserAttributInterface, PersonIdentitySourceAttributInterface
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user