infinito/application/src/Entity/Node.php

44 lines
1.3 KiB
PHP
Raw Normal View History

2018-09-05 15:46:14 +02:00
<?php
namespace App\Entity;
2018-09-06 14:03:08 +02:00
use Doctrine\ORM\Mapping as ORM;
2018-09-05 15:46:14 +02:00
use Doctrine\Common\Collections\ArrayCollection;
2018-09-06 14:03:08 +02:00
use App\Entity\Attribut\IdAttribut;
use App\Entity\Attribut\SourceAttribut;
use App\Entity\Attribut\ParentAttribut;
2018-09-06 14:34:43 +02:00
use App\Entity\Attribut\ChildsAttribut;
2018-09-05 15:46:14 +02:00
/**
*
* @author kevinfrantz
2018-09-06 14:03:08 +02:00
* @ORM\Table(name="node")
* @ORM\Entity(repositoryClass="App\Repository\NodeRepository")
2018-09-05 15:46:14 +02:00
*/
class Node implements NodeInterface
{
2018-09-06 14:34:43 +02:00
use IdAttribut,SourceAttribut, ParentAttribut, ChildsAttribut;
2018-09-05 15:46:14 +02:00
/**
2018-09-06 14:34:43 +02:00
* 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 ArrayCollection|Node[]
*/
protected $parents;
/**
* Many Nodes have many childs
* @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-05 15:46:14 +02:00
* @var ArrayCollection|Node[]
*/
protected $childs;
}