infinito/application/src/Entity/Attribut/ChildsAttribut.php

36 lines
791 B
PHP
Raw Normal View History

2018-09-06 14:34:43 +02:00
<?php
2018-09-12 22:25:22 +02:00
2018-09-06 14:34:43 +02:00
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\ArrayCollection;
2018-09-06 15:14:33 +02:00
use App\Entity\NodeInterface;
2018-09-06 14:34:43 +02:00
/**
* @author kevinfrantz
*/
2018-09-12 22:25:22 +02:00
trait ChildsAttribut
{
2018-09-06 15:14:33 +02:00
/**
2018-09-12 22:25:22 +02:00
* Many Nodes have many childs.
*
2018-09-06 15:14:33 +02:00
* @ORM\ManyToMany(targetEntity="Node")
* @ORM\JoinTable(name="nodes_childs",
* joinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="node_id", referencedColumnName="id")}
* )
2018-09-12 22:25:22 +02:00
*
2018-09-06 15:14:33 +02:00
* @var ArrayCollection|NodeInterface[]
2018-09-06 14:34:43 +02:00
*/
protected $childs;
2018-09-12 22:25:22 +02:00
2018-09-06 14:34:43 +02:00
public function getChilds(): ArrayCollection
{
return $this->getChilds();
}
2018-09-12 22:25:22 +02:00
2018-09-06 14:34:43 +02:00
public function setChilds(ArrayCollection $childs): void
{
$this->childs = $childs;
}
}