Optimized ORM Draft

This commit is contained in:
Kevin Frantz
2018-09-06 14:34:43 +02:00
parent f9e44deac4
commit bccafb4740
6 changed files with 68 additions and 19 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @author kevinfrantz
*
*/
trait ChildsAttribut {
/**
* @var ArrayCollection
*/
protected $childs;
public function getChilds(): ArrayCollection
{
return $this->getChilds();
}
public function setChilds(ArrayCollection $childs): void
{
$this->childs = $childs;
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @author kevinfrantz
*
*/
interface ChildsAttributeInterface
{
public function setChilds(ArrayCollection $childs):void;
public function getChilds():ArrayCollection;
}

View File

@@ -12,7 +12,7 @@ trait NodeAttribut{
/**
* @var NodeInterface
* @ORM\OneToOne(targetEntity="Node")
* @ORM\JoinColumn(name="source", referencedColumnName="id")
* @ORM\JoinColumn(name="node_id", referencedColumnName="id")
*/
protected $node;

View File

@@ -2,7 +2,6 @@
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\NodeInterface;
/**
*
@@ -10,9 +9,9 @@ use App\Entity\NodeInterface;
*
*/
trait ParentAttribut {
/**
*
* @var ArrayCollection|NodeInterface[]
* @var ArrayCollection
*/
protected $parents;