Ver Mensaje Individual
  #10 (permalink)  
Antiguo 26/03/2013, 09:07
wilmer30
 
Fecha de Ingreso: enero-2010
Mensajes: 491
Antigüedad: 14 años, 3 meses
Puntos: 12
Respuesta: Asociaciones en doctrine 2

Crei que había solucionado mi problema sin embargo al generar entities me bota este error:

Cita:
[Creation Error] The annotation @OneToMany declared on property Entities\Departamento::$parent does not have a property named "inve
rsedBy". Available properties: mappedBy, targetEntity, cascade, fetch, orphanRemoval, indexBy
y estas son mi annotation
Código PHP:
Ver original
  1. <?php
  2.  
  3. namespace Entities;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6.  
  7. /**
  8.  * Departamento
  9.  *
  10.  * @Table(name="departamento")
  11.  * @Entity
  12.  */
  13. class Departamento
  14. {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @Column(name="id", type="integer", nullable=false)
  19.      * @Id
  20.      * @GeneratedValue(strategy="IDENTITY")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @OneToMany(targetEntity="Departamento", inversedBy="departamentos")
  25.      * @JoinColumn(name="departamento_id", referencedColumnName="id")
  26.      **/
  27.     private $parent;
  28.  
  29.     /**
  30.      * @var \Departamento
  31.      *
  32.      * @ManyToOne(targetEntity="Departamento",mappedBy="parent")
  33.      * @JoinColumns({
  34.      *   @JoinColumn(name="departamento_id", type="integer")
  35.      * })
  36.      */
  37.     private $departamentos;
  38.  
  39.     /**
  40.      * @var string
  41.      *
  42.      * @Column(name="estado", type="string", length=1, nullable=false)
  43.      */
  44.     private $estado;
  45.  
  46.     public function __construct(){
  47.         $this ->departamentos = new \Doctrine\Common\Coollections\ArrayCollection();
  48.     }
  49.  
  50. }
el mensaje esta claro pero no se exactamento por que