for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AppBundle\Repository;
/**
* EventRepository.
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class EventRepository extends \Doctrine\ORM\EntityRepository
{
public function findByGoogleId($id)
return $this->createQueryBuilder('event')
->andWhere('event.googleId = :id')
->setParameter('id', $id)
->getQuery()
->getSingleResult();
}
public function selectNotExpiredByUser($user)
->andWhere('event.user = :user')
->setParameter('user', $user)
->andWhere('event.expiredAt >= :date')
->setParameter('date', new \DateTime())
->getResult();