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

36 lines
776 B
PHP
Raw Normal View History

2018-09-13 22:35:32 +02:00
<?php
namespace App\Entity\Attribut;
use App\Entity\NodeInterface;
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")}
* )
*
* @var Collection|NodeInterface[]
2018-09-13 22:35:32 +02:00
*/
protected $parents;
public function getParents(): Collection
2018-09-13 22:35:32 +02:00
{
return $this->parents;
}
public function setParents(Collection $parents): void
2018-09-13 22:35:32 +02:00
{
$this->parents = $parents;
}
}