Created
February 10, 2013 10:47
-
-
Save coma/4749188 to your computer and use it in GitHub Desktop.
repo sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @ORM\Entity(repositoryClass="Comakai\TicketsBundle\Repository\TicketRepository") | |
*/ | |
class Ticket... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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