mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-14 06:07:18 +02:00
Optimized ORM Draft
This commit is contained in:
28
application/src/Entity/Attribut/ChildsAttribut.php
Normal file
28
application/src/Entity/Attribut/ChildsAttribut.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
15
application/src/Entity/Attribut/ChildsAttributeInterface.php
Normal file
15
application/src/Entity/Attribut/ChildsAttributeInterface.php
Normal 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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user