ProgramaNivelRepository.php 906 Bytes
<?php

namespace UBV\SurUbvBundle\Entity;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\Query;
/**
 * ProgramaNivelRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ProgramaNivelRepository extends EntityRepository
{
  public function findProgramaNivelById($programaNivelId) {
    $em = $this->getEntityManager();
    
    $result = $em->createQueryBuilder();
    
    $dql = $result->select('programaNivel.descripcion')
            ->from('UBVSurUbvBundle:ProgramaNivel', 'programaNivel')
            ->where('programaNivel.id = :programaNivelId')
            ->setParameter('programaNivelId', $programaNivelId)
            ->getQuery()
            ->getOneOrNullResult(Query::HYDRATE_ARRAY);
            //->getResult(Query::HYDRATE_ARRAY);
    
    //die(dump($dql));
    return $dql;
  }
}