Ver Mensaje Individual
  #12 (permalink)  
Antiguo 23/05/2011, 12:35
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 4 meses
Puntos: 845
Respuesta: Doctrine2 error al hacer getQuery

Lo que me estas mostrando es una clase pero no es un Entity, debería ser algo así:

Código PHP:
Ver original
  1. namespace GOU\Entity;
  2.  
  3. /**
  4.  *
  5.  * @Entity
  6.  * @Table(name="ladders")
  7.  *
  8.  */
  9. class Ladder
  10. {
  11.     /**
  12.      * @Id @Column(type="integer") @GeneratedValue
  13.      * @var integer $id
  14.      */
  15.     private $id;
  16.    
  17.     /**
  18.      * @Column(length="50", unique="true", nullable="false")   
  19.      * @var string $name
  20.      */
  21.     private $name;
  22.    
  23.     /**
  24.      * @Column(type="text")  
  25.      * @var text $description
  26.      */
  27.     private $description;
  28.    
  29.     /**
  30.      * @Column(name="started_at", type="datetime") 
  31.      * @var DateTime $startAt
  32.      */
  33.     private $startAt;
  34.    
  35.     /**
  36.      * @ManyToMany(targetEntity="GOU\Entity\Clan", inversedBy="ladders")
  37.      * @var Doctrine\Common\Collections\ArrayCollection
  38.      */
  39.     private $teams;
  40.    
  41.     /**  
  42.      * Ladder constructor
  43.      */
  44.     public function __construct()
  45.     {
  46.         $this->teams = new Doctrine\Common\Collections\ArrayCollection();
  47.     }
  48.    
  49.     /**
  50.      * Get Id
  51.      * @return integer   
  52.      */
  53.     public function getId()
  54.     {
  55.         return $this->id;
  56.     }
  57.    
  58.     /**  
  59.      * Setter name
  60.      * @param string $name
  61.      */
  62.     public function setName($name)
  63.     {
  64.         $this->name = $name;
  65.     }
  66.    
  67.     /**
  68.      * Getter name
  69.      * @return string    
  70.      */
  71.     public function getName()
  72.     {
  73.         return $this->name;
  74.     }
  75.    
  76.     /**  
  77.      * Setter description
  78.      * @param text $desc
  79.      */
  80.     public function setDescription($desc)
  81.     {
  82.         $this->description = $desc;
  83.     }
  84.    
  85.     /**
  86.      * Getter description
  87.      * @return text  
  88.      */
  89.     public function getDescription()
  90.     {
  91.         return $this->description;
  92.     }
  93.        
  94.     /**  
  95.      * Setter startAt
  96.      * @param DateTime $startAt
  97.      */
  98.     public function setStartAt(DateTime $time)
  99.     {
  100.         $this->startAt = $time;
  101.     }
  102.    
  103.     /**
  104.      * Getter startAt
  105.      * @return Datetime  
  106.      */
  107.     public function getStartAt()
  108.     {
  109.         return $this->startAt;
  110.     }
  111.    
  112.    
  113.     /**
  114.      * Get ladders
  115.      * @return Doctrine\Common\Collections\ArrayCollection
  116.      */
  117.     public function getLadders()
  118.     {
  119.         return $this->modes;
  120.     }
  121.    
  122.     /**
  123.      * Add team
  124.      * @param \GOU\Entity\Clan $team
  125.      */
  126.     public function addTeam(\GOU\Entity\Clan $team)
  127.     {
  128.         $this->teams[] = $team;
  129.     }
  130.    
  131.     /**
  132.      * @return Doctrine\Common\Collections\ArrayCollection;
  133.      */
  134.     public function getTeams()
  135.     {
  136.         return $this->teams;
  137.     }
  138. }

Te sugiero que empieces por leer la documentación http://www.doctrine-project.org/docs...roduction.html.

Saludos.
__________________
http://es.phptherightway.com/
thats us riders :)