From 69dbc58954e6c558b55b3b1207a9d021be7991f8 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 11 Nov 2018 21:24:54 +0100 Subject: [PATCH] Implemented surname attribut and nameattribut --- .../Entity/Attribut/SurnameSourceAttribut.php | 12 ++++++++++ .../SurnameSourceAttributInterface.php | 23 +++++++++++++++++++ .../Combination/FullPersonNameSource.php | 4 ++++ .../FullPersonNameSourceInterface.php | 8 +++---- .../Source/Data/Name/AbstractNameSource.php | 2 ++ 5 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 application/src/Entity/Attribut/SurnameSourceAttribut.php create mode 100644 application/src/Entity/Attribut/SurnameSourceAttributInterface.php diff --git a/application/src/Entity/Attribut/SurnameSourceAttribut.php b/application/src/Entity/Attribut/SurnameSourceAttribut.php new file mode 100644 index 0000000..c7bbd5a --- /dev/null +++ b/application/src/Entity/Attribut/SurnameSourceAttribut.php @@ -0,0 +1,12 @@ +surnameSource; + } + + public function setSurname(SurnameSourceInterface $name): void + { + $this->surnameSource = $name; + } +} diff --git a/application/src/Entity/Source/Combination/FullPersonNameSource.php b/application/src/Entity/Source/Combination/FullPersonNameSource.php index 1681e50..94e9cb3 100644 --- a/application/src/Entity/Source/Combination/FullPersonNameSource.php +++ b/application/src/Entity/Source/Combination/FullPersonNameSource.php @@ -2,6 +2,10 @@ namespace App\Entity\Source\Combination; +use App\Entity\Attribut\FirstNameSourceAttribut; +use App\Entity\Attribut\SurnameSourceAttribut; + class FullPersonNameSource extends AbstractCombinationSource implements FullPersonNameSourceInterface { + use FirstNameSourceAttribut,SurnameSourceAttribut; } diff --git a/application/src/Entity/Source/Combination/FullPersonNameSourceInterface.php b/application/src/Entity/Source/Combination/FullPersonNameSourceInterface.php index 44fb443..5643bd6 100644 --- a/application/src/Entity/Source/Combination/FullPersonNameSourceInterface.php +++ b/application/src/Entity/Source/Combination/FullPersonNameSourceInterface.php @@ -2,16 +2,14 @@ namespace App\Entity\Source\Combination; -use App\Entity\Source\Data\Name\SurnameSourceInterface; +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 +interface FullPersonNameSourceInterface extends CombinationSourceInterface, FirstNameSourceAttributInterface, SurnameSourceAttributInterface { - public function getSurname(): SurnameSourceInterface; - - public function setSurname(SurnameSourceInterface $name): void; } diff --git a/application/src/Entity/Source/Data/Name/AbstractNameSource.php b/application/src/Entity/Source/Data/Name/AbstractNameSource.php index 8b95e59..464bbea 100644 --- a/application/src/Entity/Source/Data/Name/AbstractNameSource.php +++ b/application/src/Entity/Source/Data/Name/AbstractNameSource.php @@ -3,7 +3,9 @@ namespace App\Entity\Source\Data\Name; use App\Entity\Source\Data\AbstractDataSource; +use App\Entity\Attribut\NameAttribut; abstract class AbstractNameSource extends AbstractDataSource implements NameSourceInterface { + use NameAttribut; }