Refactored draft for Request Management

This commit is contained in:
Kevin Frantz
2019-01-20 12:54:56 +01:00
parent 7e9916b27b
commit 86198ff2df
40 changed files with 490 additions and 176 deletions

View File

@@ -5,13 +5,15 @@ namespace App\Entity;
use App\Entity\Attribut\IdAttribut;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Attribut\VersionAttribut;
use App\Entity\Attribut\SlugAttribut;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @author kevinfrantz
*/
abstract class AbstractEntity implements EntityInterface
{
use IdAttribut, VersionAttribut;
use IdAttribut, VersionAttribut,SlugAttribut;
/**
* @ORM\Id()
@@ -29,6 +31,21 @@ abstract class AbstractEntity implements EntityInterface
*/
protected $version;
/**
* System slugs should be writen in UPPER CASES
* Slugs which are defined by the user are checked via the assert.
*
* @ORM\Column(type="string",length=30,nullable=true,unique=true)
* @Assert\Regex(pattern="/^[a-z]+$/")
*
* @todo Check out if a plugin can solve this purpose;
*
* @see https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/sluggable.md
*
* @var string
*/
protected $slug;
public function __construct()
{
$this->version = 0;

View File

@@ -4,10 +4,11 @@ namespace App\Entity;
use App\Entity\Attribut\VersionAttributInterface;
use App\Entity\Attribut\IdAttributInterface;
use App\Entity\Attribut\SlugAttributInterface;
/**
* @author kevinfrantz
*/
interface EntityInterface extends VersionAttributInterface, IdAttributInterface
interface EntityInterface extends VersionAttributInterface, IdAttributInterface,SlugAttributInterface
{
}

View File

@@ -8,7 +8,6 @@ use App\Entity\AbstractEntity;
use App\Entity\Attribut\LawAttribut;
use App\Entity\Meta\LawInterface;
use App\Entity\Meta\Law;
use App\Entity\Attribut\SlugAttribut;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\Attribut\CreatorRelationAttribut;
@@ -49,22 +48,7 @@ use App\Entity\Meta\Relation\Member\MemberRelationInterface;
*/
abstract class AbstractSource extends AbstractEntity implements SourceInterface
{
use LawAttribut,SlugAttribut,CreatorRelationAttribut, MemberRelationAttribut;
/**
* System slugs should be writen in UPPER CASES
* Slugs which are defined by the user are checked via the assert.
*
* @ORM\Column(type="string",length=30,nullable=true,unique=true)
* @Assert\Regex(pattern="/^[a-z]+$/")
*
* @todo Check out if a plugin can solve this purpose;
*
* @see https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/sluggable.md
*
* @var string
*/
protected $slug;
use LawAttribut,CreatorRelationAttribut, MemberRelationAttribut;
/**
* @var CreatorRelationInterface

View File

@@ -5,13 +5,12 @@ namespace App\Entity\Source;
use App\Entity\Attribut\IdAttributInterface;
use App\Entity\EntityInterface;
use App\Entity\Attribut\LawAttributInterface;
use App\Entity\Attribut\SlugAttributInterface;
use App\Entity\Attribut\CreatorRelationAttributInterface;
use App\Entity\Attribut\MemberRelationAttributInterface;
/**
* @author kevinfrantz
*/
interface SourceInterface extends IdAttributInterface, EntityInterface, LawAttributInterface, SlugAttributInterface, CreatorRelationAttributInterface, MemberRelationAttributInterface
interface SourceInterface extends IdAttributInterface, EntityInterface, LawAttributInterface, CreatorRelationAttributInterface, MemberRelationAttributInterface
{
}