2015-06-23 09:38:43 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Skobkin\Bundle\PointToolsBundle\Entity;
|
|
|
|
|
|
|
|
use Doctrine\ORM\EntityRepository;
|
|
|
|
|
|
|
|
class SubscriptionEventRepository extends EntityRepository
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return integer
|
|
|
|
*/
|
|
|
|
public function getLastDayEventsCount()
|
|
|
|
{
|
|
|
|
$qb = $this->createQueryBuilder('se');
|
|
|
|
|
|
|
|
$now = new \DateTime();
|
|
|
|
|
2015-06-23 09:42:59 +00:00
|
|
|
return $qb
|
2015-06-23 09:38:43 +00:00
|
|
|
->select('COUNT(se)')
|
|
|
|
->where('se.date > :time')
|
|
|
|
->setParameter('time', $now->sub(new \DateInterval('PT24H')))
|
|
|
|
->getQuery()->getSingleScalarResult()
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|