This is my Categorias model: http://pastebin.com/Wk5iw3Hf
and
this is my Proyectos model: http://pastebin.com/LDTpZ3Cy
One Category has many proyects.
In my repository, I´m trying to join this models, like this:
public function findMistareas() {
$em = $this->getEntityManager();
$consulta = $em->createQuery('SELECT c, p FROM GestionBundle:Categorias c JOIN c.proyectos p ');
return $consulta->getResult();
}
but I´m getting this error:
Notice: Undefined index: Categorias in /Users/gitek/www/ges/vendor/doctrine/lib/Doctrine/ORM/Query/SqlWalker.php line 747
any help or clue? Maybe the problem is on the Model? but I can not see where.
‘SELECT p, h FROM GestionBundle:Proyectos p JOIN p.hitos h ‘
Your question is about categories but your query uses hitos? The mappedBy and inversedBy are case sensitive so probably need mappedBy=”proyectos” instead of mappedBy=”Proyectos”