mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 06:01:35 +01:00
Implemented fullpersonnamesource orm mapping
This commit is contained in:
parent
08c4bee43f
commit
0c852dbec4
@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* @ORM\Table(name="source_combination")
|
* @ORM\Table(name="source_combination")
|
||||||
* @ORM\InheritanceType("JOINED")
|
* @ORM\InheritanceType("JOINED")
|
||||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||||
* @ORM\DiscriminatorMap({"user" = "UserSource","fullpersonname" = "FullPersonNameSource","personidentitysource"="PersonIdentitySource"})
|
* @ORM\DiscriminatorMap({"user" = "UserSource","fullpersonname" = "FullPersonNameSource","personidentitysource"="PersonIdentitySource","fullpersonnamesource"="FullPersonNameSource"})
|
||||||
*/
|
*/
|
||||||
abstract class AbstractCombinationSource extends AbstractSource implements CombinationSourceInterface
|
abstract class AbstractCombinationSource extends AbstractSource implements CombinationSourceInterface
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,13 @@ use App\Entity\Attribut\FirstNameSourceAttribut;
|
|||||||
use App\Entity\Attribut\SurnameSourceAttribut;
|
use App\Entity\Attribut\SurnameSourceAttribut;
|
||||||
use App\Entity\Source\Data\Name\SurnameSource;
|
use App\Entity\Source\Data\Name\SurnameSource;
|
||||||
use App\Entity\Source\Data\Name\FirstNameSource;
|
use App\Entity\Source\Data\Name\FirstNameSource;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kevinfrantz
|
||||||
|
* @ORM\Table(name="source_combination_fullpersonname")
|
||||||
|
* @ORM\Entity()
|
||||||
|
*/
|
||||||
class FullPersonNameSource extends AbstractCombinationSource implements FullPersonNameSourceInterface
|
class FullPersonNameSource extends AbstractCombinationSource implements FullPersonNameSourceInterface
|
||||||
{
|
{
|
||||||
use FirstNameSourceAttribut,SurnameSourceAttribut;
|
use FirstNameSourceAttribut,SurnameSourceAttribut;
|
||||||
|
@ -15,6 +15,9 @@ class PersonIdentitySource extends AbstractCombinationSource implements PersonId
|
|||||||
use FullPersonNameSourceAttribut;
|
use FullPersonNameSourceAttribut;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\OneToOne(targetEntity="FullPersonNameSource",cascade={"persist", "remove"})
|
||||||
|
* @ORM\JoinColumn(name="fullname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||||
|
*
|
||||||
* @var FullPersonNameSourceInterface
|
* @var FullPersonNameSourceInterface
|
||||||
*/
|
*/
|
||||||
protected $fullPersonNameSource;
|
protected $fullPersonNameSource;
|
||||||
|
@ -26,6 +26,7 @@ class UserSource extends AbstractCombinationSource implements UserSourceInterfac
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToOne(targetEntity="PersonIdentitySource",cascade={"persist", "remove"})
|
* @ORM\OneToOne(targetEntity="PersonIdentitySource",cascade={"persist", "remove"})
|
||||||
|
* @ORM\JoinColumn(name="identity_id", referencedColumnName="id",onDelete="CASCADE")
|
||||||
*
|
*
|
||||||
* @var PersonIdentitySourceInterface
|
* @var PersonIdentitySourceInterface
|
||||||
*/
|
*/
|
||||||
|
@ -52,6 +52,7 @@ class UserRepositoryTest extends KernelTestCase
|
|||||||
$this->assertEquals($userId, $this->loadedUser->getId());
|
$this->assertEquals($userId, $this->loadedUser->getId());
|
||||||
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getId());
|
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getId());
|
||||||
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getPersonIdentitySource()->getId());
|
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getPersonIdentitySource()->getId());
|
||||||
|
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getPersonIdentitySource()->getFullPersonNameSource()->getId());
|
||||||
$this->deleteUser();
|
$this->deleteUser();
|
||||||
$this->assertNull($this->userRepository->find($userId));
|
$this->assertNull($this->userRepository->find($userId));
|
||||||
$this->loadedUser = null;
|
$this->loadedUser = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user