mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 22:37:28 +01:00
36 lines
776 B
PHP
36 lines
776 B
PHP
<?php
|
|
|
|
namespace App\Entity\Attribut;
|
|
|
|
use App\Entity\NodeInterface;
|
|
use Doctrine\Common\Collections\Collection;
|
|
|
|
/**
|
|
* @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")}
|
|
* )
|
|
*
|
|
* @var Collection|NodeInterface[]
|
|
*/
|
|
protected $parents;
|
|
|
|
public function getParents(): Collection
|
|
{
|
|
return $this->parents;
|
|
}
|
|
|
|
public function setParents(Collection $parents): void
|
|
{
|
|
$this->parents = $parents;
|
|
}
|
|
}
|