2018-09-13 22:35:32 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Entity\Attribut;
|
|
|
|
|
|
|
|
use App\Entity\NodeInterface;
|
2018-09-14 18:26:09 +02:00
|
|
|
use Doctrine\Common\Collections\Collection;
|
2018-09-13 22:35:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
trait ParentsAttribut
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Many Nodes have many parents.
|
|
|
|
*
|
|
|
|
* @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-14 18:26:09 +02:00
|
|
|
* @var Collection|NodeInterface[]
|
2018-09-13 22:35:32 +02:00
|
|
|
*/
|
|
|
|
protected $parents;
|
|
|
|
|
2018-09-14 18:26:09 +02:00
|
|
|
public function getParents(): Collection
|
2018-09-13 22:35:32 +02:00
|
|
|
{
|
|
|
|
return $this->parents;
|
|
|
|
}
|
|
|
|
|
2018-09-14 18:26:09 +02:00
|
|
|
public function setParents(Collection $parents): void
|
2018-09-13 22:35:32 +02:00
|
|
|
{
|
|
|
|
$this->parents = $parents;
|
|
|
|
}
|
|
|
|
}
|