2018-09-06 13:52:34 +02:00
|
|
|
<?php
|
2018-09-12 22:25:22 +02:00
|
|
|
|
2018-09-06 14:03:08 +02:00
|
|
|
namespace App\Entity\Attribut;
|
2018-09-06 13:52:34 +02:00
|
|
|
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
2018-09-06 15:14:33 +02:00
|
|
|
use App\Entity\NodeInterface;
|
2018-09-06 13:52:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
2018-09-12 22:25:22 +02:00
|
|
|
trait ParentAttribut
|
|
|
|
{
|
2018-09-06 13:52:34 +02:00
|
|
|
/**
|
2018-09-12 22:25:22 +02:00
|
|
|
* Many Nodes have many parents.
|
2018-09-06 15:14:33 +02:00
|
|
|
*
|
|
|
|
* @ORM\ManyToMany(targetEntity="Node")
|
|
|
|
* @ORM\JoinTable(name="nodes_parents",
|
|
|
|
* 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 13:52:34 +02:00
|
|
|
*/
|
|
|
|
protected $parents;
|
2018-09-06 15:14:33 +02:00
|
|
|
|
2018-09-06 13:52:34 +02:00
|
|
|
public function getParents(): ArrayCollection
|
|
|
|
{
|
|
|
|
return $this->parents;
|
|
|
|
}
|
2018-09-06 15:14:33 +02:00
|
|
|
|
2018-09-06 13:52:34 +02:00
|
|
|
public function setParents(ArrayCollection $parents): void
|
|
|
|
{
|
|
|
|
$this->parents = $parents;
|
|
|
|
}
|
|
|
|
}
|