mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-08 13:51:34 +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\InheritanceType("JOINED")
|
||||
* @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
|
||||
{
|
||||
|
@ -6,7 +6,13 @@ use App\Entity\Attribut\FirstNameSourceAttribut;
|
||||
use App\Entity\Attribut\SurnameSourceAttribut;
|
||||
use App\Entity\Source\Data\Name\SurnameSource;
|
||||
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
|
||||
{
|
||||
use FirstNameSourceAttribut,SurnameSourceAttribut;
|
||||
|
@ -15,6 +15,9 @@ class PersonIdentitySource extends AbstractCombinationSource implements PersonId
|
||||
use FullPersonNameSourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="FullPersonNameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="fullname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var FullPersonNameSourceInterface
|
||||
*/
|
||||
protected $fullPersonNameSource;
|
||||
|
@ -26,6 +26,7 @@ class UserSource extends AbstractCombinationSource implements UserSourceInterfac
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="PersonIdentitySource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="identity_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var PersonIdentitySourceInterface
|
||||
*/
|
||||
|
@ -52,6 +52,7 @@ class UserRepositoryTest extends KernelTestCase
|
||||
$this->assertEquals($userId, $this->loadedUser->getId());
|
||||
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getId());
|
||||
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getPersonIdentitySource()->getId());
|
||||
$this->assertGreaterThan(0, $this->loadedUser->getSource()->getPersonIdentitySource()->getFullPersonNameSource()->getId());
|
||||
$this->deleteUser();
|
||||
$this->assertNull($this->userRepository->find($userId));
|
||||
$this->loadedUser = null;
|
||||
|
Loading…
Reference in New Issue
Block a user