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 <?php
namespace App\Entity\Attribut; namespace App\Entity\Attribut;
use App\Entity\Meta\Relation\CreatorRelationInterface; use App\Entity\Meta\Relation\CreatorRelationInterface;
@ -9,13 +10,14 @@ trait CreatorRelationAttribut
* @var CreatorRelationInterface * @var CreatorRelationInterface
*/ */
protected $creatorRelation; protected $creatorRelation;
public function setCreatorRelation(CreatorRelationInterface $creatorRelation){ public function setCreatorRelation(CreatorRelationInterface $creatorRelation)
{
$this->creatorRelation = $creatorRelation; $this->creatorRelation = $creatorRelation;
} }
public function getCreatorRelation():CreatorRelationInterface{ public function getCreatorRelation(): CreatorRelationInterface
{
return $this->creatorRelation; return $this->creatorRelation;
} }
} }

View File

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

View File

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

View File

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

View File

@ -8,4 +8,4 @@ use App\Entity\Attribut\MembershipsAttributInterface;
interface MemberRelationInterface extends RelationInterface, MembersAttributInterface, MembershipsAttributInterface interface MemberRelationInterface extends RelationInterface, MembersAttributInterface, MembershipsAttributInterface
{ {
} }

View File

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

View File

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

View File

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

View File

@ -13,6 +13,6 @@ use App\Entity\Attribut\CreatorRelationAttributInterface;
/** /**
* @author kevinfrantz * @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; namespace App\Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase; 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\CreatorRelationAttributInterface;
use App\Entity\Attribut\CreatorRelationAttribut; use App\Entity\Attribut\CreatorRelationAttribut;
use App\Entity\Meta\Relation\CreatorRelationInterface; use App\Entity\Meta\Relation\CreatorRelationInterface;

View File

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