Repository/SellerWindowRepository.php
public function findOneForHubIdAndStartTime($hub_id, $start_time)
    {
        $qb = $this->getEntityManager()->createQueryBuilder()
            ->from('HarvestCloudCoreBundle:SellerWindow', 'pw')
            ->select('pw')
            ->where('pw.start_time = :start_time')
            ->andWhere('pw.start_time > :now')
            ->setParameter('start_time', date('Y-m-d H:i:s', $start_time))
            ->setParameter('now', date('Y-m-d H:i:s'))
        ;

        $q = $qb->getQuery();

        return $q->getOneOrNullResult();
    }
public function findOneForHubIdAndStartTime($hub_id, $start_time)
    {
        $qb = $this->getEntityManager()->createQueryBuilder()
            ->from('HarvestCloudCoreBundle:SellerWindow', 'pw')
            ->select('pw')
            ->where('pw.start_time = :start_time')
            ->andWhere('pw.start_time > :now')
            ->setParameter('start_time', date('Y-m-d H:i:s', $start_time))
            ->setParameter('now', date('Y-m-d H:i:s'))
        ;

        $q = $qb->getQuery();

        return $q->getOneOrNullResult();
    }
public function findOneForHubIdAndStartTime ( $ hub_id , $ start_time ) { $ qb = $ this -> getEntityManager ( ) -> createQueryBuilder ( ) -> from ( 'HarvestCloudCoreBundle:SellerWindow' , 'pw' ) -> select ( 'pw' ) -> where ( 'pw.start_time = :start_time' ) -> andWhere ( 'pw.start_time > :now' ) -> setParameter ( 'start_time' , date ( 'Y-m-d H:i:s' , $ start_time ) ) -> setParameter ( 'now' , date ( 'Y-m-d H:i:s' ) ) ; $ q = $ qb -> getQuery ( ) ; return $ q -> getOneOrNullResult ( ) ; }
Find for hub_id and datetime

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-05-19

@param  int     $hub_id
@param  string  $start_time
Find for hub_id and datetime