Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2013, 16:14
carlosml08
 
Fecha de Ingreso: septiembre-2013
Mensajes: 61
Antigüedad: 10 años, 8 meses
Puntos: 0
Pregunta Problemas con el repositorio de symfony2

He creado un repositorio pero cuando lo ejecuto desde el controlador y revizo las Queries que se ejecutan desde Doctrine veo que no se ha ejecutado.
Les muestro el codigo:
Código PHP:
REPOSITORIO
<?php
namespace ABCUpreportsBundleRepository
;
use 
DoctrineORMEntityRepository;
/**
 * MenuRepository
 */
class RuleCommentRepository extends EntityRepository

public function 
findSubjectByActiveSy()
    {    
    
$dql "SELECT s,rc FROM ABCUpreportsBundle:RuleComment rc JOIN rc.subject s JOIN rc.termCal tc JOIN tc.sy sy WHERE  tc.active='true' and tc.releaseCal='true' and sy.status='true'";        
    
$repositorio $this->getEntityManager()->createQuery($dql);
    return 
$repositorio;    
    }
}
Código PHP:
ENTIDAD
<?php

namespace ABCUpreportsBundleEntity
;

use 
DoctrineORMMapping as ORM;

/**
 * ABC\UpreportsBundle\Entity\RuleComment
 *
 * @ORM\Table(name="rule_comment")
 * @ORM\Entity(repositoryClass="ABC\UpreportsBundle\Repository\RuleCommentRepository")
 */
class RuleComment
//Aqui va todos los campos de la entidad
}
Código PHP:
CONTROLADOR DONDE LO EJECUTO
<?php
namespace ABCUpreportsBundleController
;
use 
ABCUpreportsBundleEntityRuleComment;
class 
StudentGradeController extends Controller
{
public function 
averageAction($upclass)
    {
$subjects $em->getRepository('ABCUpreportsBundle:RuleComment')->findSubjectByActiveSy();
  return array(
'subjects' => $subjects,
        );
    }
}
De antemano les agradezco su ayuda.