Changed data to primitive folder

This commit is contained in:
Kevin Frantz
2018-11-21 17:16:32 +01:00
parent 9a3801152f
commit 706a439b52
25 changed files with 35 additions and 35 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Entity\Source\Primitive;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Source\AbstractSource;
/**
* @author kevinfrantz
*
* @ORM\Entity
* @ORM\Table(name="source_data")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"name" = "App\Entity\Source\Primitive\Name\AbstractNameSource"})
*/
abstract class AbstractDataSource extends AbstractSource implements DataSourceInterface
{
}

View File

@@ -0,0 +1,9 @@
<?php
namespace App\Entity\Source\Primitive;
use App\Entity\Source\SourceInterface;
interface DataSourceInterface extends SourceInterface
{
}

View File

@@ -0,0 +1,39 @@
<?php
namespace App\Entity\Source\Primitive\Name;
use App\Entity\Source\Primitive\AbstractDataSource;
use App\Entity\Attribut\NameAttribut;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @author kevinfrantz
*
* @todo Change to SINGLE_TABLE. JOINED was necessary because SINGLE_TABLE leaded to:
*
* @see << SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DEV_DATABASE.source_data_name' doesn't exist >>
* @ORM\Entity
* @ORM\Table(name="source_data_name")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"nickname" = "NicknameSource","firstname" = "FirstNameSource", "surname" = "SurnameSource"})
*/
class AbstractNameSource extends AbstractDataSource implements NameSourceInterface
{
use NameAttribut;
/**
* @todo Implement an extra assert Layer! - maybe ;)
* @ORM\Column(type="string",length=255)
* @Assert\NotBlank()
*
* @var string
*/
protected $name;
public function __construct()
{
parent::__construct();
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Entity\Source\Primitive\Name;
use Doctrine\ORM\Mapping as ORM;
/**
* @author kevinfrantz
* @ORM\Entity()
*/
class FirstNameSource extends AbstractNameSource implements FirstNameSourceInterface
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace App\Entity\Source\Primitive\Name;
interface FirstNameSourceInterface extends NameSourceInterface
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Entity\Source\Primitive\Name;
use App\Entity\Source\Primitive\DataSourceInterface;
use App\Entity\Attribut\NameAttributInterface;
interface NameSourceInterface extends DataSourceInterface, NameAttributInterface
{
}

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Entity\Source\Primitive\Name;
use Doctrine\ORM\Mapping as ORM;
/**
* @author kevinfrantz
* @ORM\Entity()
*/
class NicknameSource extends AbstractNameSource implements NicknameSourceInterface
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Entity\Source\Primitive\Name;
/**
* @author kevinfrantz
*/
interface NicknameSourceInterface extends NameSourceInterface
{
}

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Entity\Source\Primitive\Name;
use Doctrine\ORM\Mapping as ORM;
/**
* @author kevinfrantz
* @ORM\Entity()
*/
class SurnameSource extends AbstractNameSource implements SurnameSourceInterface
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace App\Entity\Source\Primitive\Name;
interface SurnameSourceInterface extends NameSourceInterface
{
}