mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Optimized entity mapping
This commit is contained in:
@@ -7,6 +7,8 @@ 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;
|
||||
use App\Entity\Source\Data\Name\SurnameSourceInterface;
|
||||
use App\Entity\Source\Data\Name\FirstNameSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -17,6 +19,22 @@ class FullPersonNameSource extends AbstractCombinationSource implements FullPers
|
||||
{
|
||||
use FirstNameSourceAttribut,SurnameSourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Data\Name\SurnameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="surname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var SurnameSourceInterface
|
||||
*/
|
||||
protected $surnameSource;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Data\Name\FirstNameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="firstname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var FirstNameSourceInterface
|
||||
*/
|
||||
protected $firstnNameSource;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
@@ -16,7 +16,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({"nickname" = "NicknameSource","firstname" = "FirstNameSource", "surname" = "SurnameSource"})
|
||||
*/
|
||||
abstract class AbstractNameSource extends AbstractDataSource implements NameSourceInterface
|
||||
class AbstractNameSource extends AbstractDataSource implements NameSourceInterface
|
||||
{
|
||||
use NameAttribut;
|
||||
|
||||
|
@@ -2,6 +2,12 @@
|
||||
|
||||
namespace App\Entity\Source\Data\Name;
|
||||
|
||||
final class FirstNameSource extends AbstractNameSource implements FirstNameSourceInterface
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class FirstNameSource extends AbstractNameSource implements FirstNameSourceInterface
|
||||
{
|
||||
}
|
||||
|
@@ -6,9 +6,8 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_data_name_nickname")
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
final class NicknameSource extends AbstractNameSource implements NicknameSourceInterface
|
||||
class NicknameSource extends AbstractNameSource implements NicknameSourceInterface
|
||||
{
|
||||
}
|
||||
|
@@ -6,9 +6,8 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_data_name_surname")
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
final class SurnameSource extends AbstractNameSource implements SurnameSourceInterface
|
||||
class SurnameSource extends AbstractNameSource implements SurnameSourceInterface
|
||||
{
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ use App\Exception\NotDefinedException;
|
||||
*
|
||||
* @todo move to the logic level!
|
||||
*/
|
||||
final class AndOperation extends AbstractOperation
|
||||
class AndOperation extends AbstractOperation
|
||||
{
|
||||
public function process(): void
|
||||
{
|
||||
|
Reference in New Issue
Block a user