Tema: Consulta Dql
Ver Mensaje Individual
  #10 (permalink)  
Antiguo 08/03/2016, 16:29
manelmanel8
 
Fecha de Ingreso: marzo-2012
Mensajes: 180
Antigüedad: 12 años, 1 mes
Puntos: 2
Respuesta: Consulta Dql

No me funciona

Intento encontrar el error pero no hay forma. Te dejo el controlador y una imagen del error que me da.

Gracias por tu tiempo.



Código PHP:
<?php

namespace VnfqInstComBundleController
;

use 
SymfonyBundleFrameworkBundleControllerController;
use 
VnfqInstComBundleEntityInstCom;
use 
VnfqInstComBundleEntityDistrict;
use 
VnfqInstComBundleEntityState;
use 
VnfqInstComBundleFormInstComType;
use 
VnfqInstComBundleFormDistrictType;
use 
VnfqInstComBundleFormStateType;

class 
InstComController extends Controller
{
    public function 
indexAction()
    {
        
$em $this->getDoctrine()->getManager();
        
$id 1;
        
$query $em->createQuery(
            
'SELECT i, d, s
            FROM VnfqInstComBundle:InstCom i
            JOIN VnfqInstComBundle:District d
            JOIN VnfqInstComBundle:State s
              WHERE i.id = :inst_id'
        
)->setParameter('inst_id'$id);
     
        
$instCom $query->getOneOrNullResult();
     
        
$instCom->getCity();
        
$instCom->getState();
        
        
print_r($instCom);
        
        return 
$this->render('VnfqInstComBundle:Inst_com:index.html.twig'); 
    }
}