Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/04/2013, 14:32
wilmer30
 
Fecha de Ingreso: enero-2010
Mensajes: 491
Antigüedad: 14 años, 3 meses
Puntos: 12
Respuesta: Recursividad con doctrine

mis anotaciones despues de arreglarlas quedarían asi:
Código PHP:
Ver original
  1. class Menu
  2. {
  3.     /**
  4.      * @var integer $id
  5.      *
  6.      * @Column(name="id", type="integer", nullable=false, unique=false)
  7.      * @Id
  8.      * @GeneratedValue(strategy="IDENTITY")
  9.      */
  10.     private $id;
  11.  
  12.     /**
  13.      * @var string $menu
  14.      *
  15.      * @Column(name="menu", type="string", length=30)
  16.      */
  17.     private $menu;
  18.  
  19.     /**
  20.      * @var App\Models\Menu
  21.      *
  22.      * @ManyToOne(targetEntity="Menu", inversedBy="parent_menu")
  23.      * @JoinColumn(name="menu_id", referencedColumnName="id", nullable=true)
  24.      */
  25.     private $menus;
  26.  
  27.     /**
  28.      * @OneToMany(targetEntity="Menu", mappedBy="menus")
  29.      */
  30.     private $parent_menu;
  31.  
  32.     public function __construct(){
  33.         $this->parent_menu = new ArrayCollection();
  34.     }
la extension de doctrine no llego a comprenderlo, por lo que intenté generarlo mediante este ejemplo http://wildlyinaccurate.com/simple-n...-in-doctrine-2, pero me vota este error:

Fatal error: Call to a member function getUnitOfWork() on a non-object in C:\xampp\htdocs\gdbcb\library\Doctrine\ORM\EntityR epository.php on line 170.

cómo integro la extensión Arbol de doctrine a mi proyecto?