3 namespace Rapsys\AirBundle\Repository
; 
   8 class SessionRepository 
extends \Doctrine\ORM\EntityRepository 
{ 
  10          * Find session by location, slot and date 
  12          * @param $location The location 
  13          * @param $slot The slot 
  14          * @param $date The datetime 
  16         public function findOneByLocationSlotDate($location, $slot, $date) { 
  18                 $ret = $this->getEntityManager() 
  19                         ->createQuery('SELECT s FROM RapsysAirBundle:Session s WHERE (s.location = :location AND s.slot = :slot AND s.date = :date)') 
  20                         ->setParameter('location', $location) 
  21                         ->setParameter('slot', $slot) 
  22                         ->setParameter('date', $date) 
  30          * Find sessions by date period 
  32          * @param $period The date period 
  34         public function findByDatePeriod($period) { 
  36                 $ret = $this->getEntityManager() 
  37                         ->createQuery('SELECT s FROM RapsysAirBundle:Session s WHERE s.date BETWEEN :begin AND :end') 
  38                         ->setParameter('begin', $period->getStartDate()) 
  39                         ->setParameter('end', $period->getEndDate())