Implemented surname attribut and nameattribut

This commit is contained in:
Kevin Frantz 2018-11-11 21:24:54 +01:00
parent ea20f7562a
commit 69dbc58954
5 changed files with 44 additions and 5 deletions

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entity\Attribut;
use App\Entity\Source\Data\Name\SurnameSourceInterface;
interface SurnameSourceAttributInterface
{
public function getSurname(): SurnameSourceInterface;
public function setSurname(SurnameSourceInterface $name): void;
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Entity\Attribut;
use App\Entity\Source\Data\Name\SurnameSourceInterface;
trait SurnameSourceAttribut
{
/**
* @var SurnameSourceInterface
*/
protected $surnameSource;
public function getSurname(): SurnameSourceInterface
{
return $this->surnameSource;
}
public function setSurname(SurnameSourceInterface $name): void
{
$this->surnameSource = $name;
}
}

View File

@ -2,6 +2,10 @@
namespace App\Entity\Source\Combination; namespace App\Entity\Source\Combination;
use App\Entity\Attribut\FirstNameSourceAttribut;
use App\Entity\Attribut\SurnameSourceAttribut;
class FullPersonNameSource extends AbstractCombinationSource implements FullPersonNameSourceInterface class FullPersonNameSource extends AbstractCombinationSource implements FullPersonNameSourceInterface
{ {
use FirstNameSourceAttribut,SurnameSourceAttribut;
} }

View File

@ -2,16 +2,14 @@
namespace App\Entity\Source\Combination; 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 ;) * @todo Maybe a middle name would be helpfull in the future ;)
* *
* @author kevinfrantz * @author kevinfrantz
*/ */
interface FullPersonNameSourceInterface extends CombinationSourceInterface interface FullPersonNameSourceInterface extends CombinationSourceInterface, FirstNameSourceAttributInterface, SurnameSourceAttributInterface
{ {
public function getSurname(): SurnameSourceInterface;
public function setSurname(SurnameSourceInterface $name): void;
} }

View File

@ -3,7 +3,9 @@
namespace App\Entity\Source\Data\Name; namespace App\Entity\Source\Data\Name;
use App\Entity\Source\Data\AbstractDataSource; use App\Entity\Source\Data\AbstractDataSource;
use App\Entity\Attribut\NameAttribut;
abstract class AbstractNameSource extends AbstractDataSource implements NameSourceInterface abstract class AbstractNameSource extends AbstractDataSource implements NameSourceInterface
{ {
use NameAttribut;
} }