24 lines
587 B
PHP
24 lines
587 B
PHP
<?php
|
|
|
|
namespace AppBundle\Entity;
|
|
|
|
/**
|
|
* TravelGuideRepository
|
|
*
|
|
* This class was generated by the Doctrine ORM. Add your own custom
|
|
* repository methods below.
|
|
*/
|
|
class TravelGuideRepository extends \Doctrine\ORM\EntityRepository
|
|
{
|
|
public function findByID($id)
|
|
{
|
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
|
$qb->select('tg');
|
|
$qb->from('AppBundle:TravelGuides', 'tg');
|
|
$qb->where('tg.id = :id');
|
|
$qb->setParameter('id', $id);
|
|
$qb->setMaxResults(1);
|
|
return $qb->getQuery()->getOneOrNullResult();
|
|
|
|
}
|
|
}
|