Implemented orm entity tags and formated code

This commit is contained in:
Kevin Frantz 2018-11-25 23:19:38 +01:00
parent 884c4cfaea
commit 1252f41127
11 changed files with 35 additions and 26 deletions

View File

@ -1,4 +1,5 @@
<?php
namespace App\Entity\Attribut;
use App\Entity\Meta\Relation\CreatorRelationInterface;
@ -10,12 +11,13 @@ trait CreatorRelationAttribut
*/
protected $creatorRelation;
public function setCreatorRelation(CreatorRelationInterface $creatorRelation){
public function setCreatorRelation(CreatorRelationInterface $creatorRelation)
{
$this->creatorRelation = $creatorRelation;
}
public function getCreatorRelation():CreatorRelationInterface{
public function getCreatorRelation(): CreatorRelationInterface
{
return $this->creatorRelation;
}
}

View File

@ -1,4 +1,5 @@
<?php
namespace App\Entity\Attribut;
use App\Entity\Meta\Relation\CreatorRelationInterface;
@ -7,5 +8,5 @@ interface CreatorRelationAttributInterface
{
public function setCreatorRelation(CreatorRelationInterface $creatorRelation);
public function getCreatorRelation():CreatorRelationInterface;
public function getCreatorRelation(): CreatorRelationInterface;
}

View File

@ -1,4 +1,5 @@
<?php
namespace App\Entity\Attribut;
use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
@ -6,16 +7,17 @@ use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
trait ParentRelationAttribut
{
/**
*
* @var ParentRelationInterface
*/
protected $parentRelation;
public function setParentRelation(ParentRelationInterface $parentRelation):void{
public function setParentRelation(ParentRelationInterface $parentRelation): void
{
$this->parentRelation = $parentRelation;
}
public function getParentRelation():ParentRelationInterface{
public function getParentRelation(): ParentRelationInterface
{
return $this->parentRelation;
}
}

View File

@ -1,12 +1,12 @@
<?php
namespace App\Entity\Attribut;
use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
interface ParentRelationAttributInterface
{
public function setParentRelation(ParentRelationInterface $parentRelation):void;
public function setParentRelation(ParentRelationInterface $parentRelation): void;
public function getParentRelation():ParentRelationInterface;
public function getParentRelation(): ParentRelationInterface;
}

View File

@ -6,6 +6,10 @@ use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use App\Entity\Meta\Relation\CreatorRelationInterface;
/**
* @author kevinfrantz
* @ORM\Entity()
*/
class CreatorRelation extends AbstractParentRelation
{
/**

View File

@ -5,6 +5,10 @@ namespace App\Entity\Meta\Relation\Parent;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @author kevinfrantz
* @ORM\Entity()
*/
class HeredityRelation extends AbstractParentRelation implements HeredityRelationInterface
{
/**

View File

@ -101,7 +101,7 @@ abstract class AbstractSource extends AbstractEntity implements SourceInterface
$this->creatorRelation->setSource($this);
$this->law = new Law();
$this->law->setSource($this);
/**
/*
*
* @todo Refactor the following attibutes
*/

View File

@ -13,6 +13,6 @@ use App\Entity\Attribut\CreatorRelationAttributInterface;
/**
* @author kevinfrantz
*/
interface SourceInterface extends IdAttributInterface, EntityInterface, MembershipsAttributInterface, LawAttributInterface, SlugAttributInterface, MembersAttributInterface,CreatorRelationAttributInterface
interface SourceInterface extends IdAttributInterface, EntityInterface, MembershipsAttributInterface, LawAttributInterface, SlugAttributInterface, MembersAttributInterface, CreatorRelationAttributInterface
{
}

View File

@ -3,9 +3,6 @@
namespace App\Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
use App\Entity\Attribut\ParentRelationAttributInterface;
use App\Entity\Attribut\ParentRelationAttribut;
use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
use App\Entity\Attribut\CreatorRelationAttributInterface;
use App\Entity\Attribut\CreatorRelationAttribut;
use App\Entity\Meta\Relation\CreatorRelationInterface;

View File

@ -5,7 +5,6 @@ namespace tests\unit\Entity\Source;
use PHPUnit\Framework\TestCase;
use App\Entity\Source\SourceInterface;
use App\Entity\Meta\LawInterface;
use App\Entity\Meta\RelationInterface;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\AbstractSource;
use App\Entity\EntityInterface;