Skip to content

Instantly share code, notes, and snippets.

@coma
Created February 10, 2013 10:47
Show Gist options
  • Save coma/4749188 to your computer and use it in GitHub Desktop.
Save coma/4749188 to your computer and use it in GitHub Desktop.
repo sample
/**
* @ORM\Entity(repositoryClass="Comakai\TicketsBundle\Repository\TicketRepository")
*/
class Ticket...
<?php
namespace Comakai\TicketsBundle\Repository;
use Doctrine\ORM\EntityRepository;
class TicketRepository extends EntityRepository
{
public function findFirst()
{
return $this
->createQueryBuilder('a')
->setMaxResults(1)
->getQuery()
->getOneOrNullResult();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment