Added name source draft

This commit is contained in:
Kevin Frantz 2018-09-14 14:12:43 +02:00
parent 5136cec81d
commit bfd5d9416e
7 changed files with 106 additions and 1 deletions

View File

@ -12,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"user" = "UserSource"})
* @ORM\DiscriminatorMap({"user" = "UserSource","name" = "NameSource"})
*/
abstract class AbstractSource extends AbstractEntity implements SourceInterface
{

View File

@ -0,0 +1,27 @@
<?php
namespace App\Entity\Attribut;
/**
*
* @author kevinfrantz
*
*/
trait NameAttribut {
/**
*
* @var string
*/
protected $name;
public function setName(string $name): void
{
$this->name = $name;
}
public function getName(): string
{
return $this->name;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Entity\Attribut;
/**
*
* @author kevinfrantz
*
*/
interface NameAttributInterface
{
public function setName(string $name):void;
public function getName():string;
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Entity;
use App\Entity\Attribut\NameAttribut;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @author kevinfrantz
* @ORM\Table(name="source_name")
* @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository")
*/
class NameSource extends AbstractSource implements NameSourceInterface
{
use NameAttribut;
/**
* @ORM\Column(type="string",length=255)
* @var string
*/
protected $name;
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Entity;
use App\Entity\Attribut\NameAttributInterface;
/**
*
* @author kevinfrantz
*
*/
interface NameSourceInterface extends NameAttributInterface
{
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Form;
/**
*
* @author kevinfrantz
*
*/
class NameSourceType
{
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
/**
*
* @author kevinfrantz
*
*/
class UserSourceType extends AbstractType
{
}