06 Feb
This commit is contained in:
parent
98bd71c760
commit
8b2ec705c9
83 changed files with 3467 additions and 1214 deletions
|
|
@ -28,4 +28,20 @@ class FewoLodgingRepository extends \Doctrine\ORM\EntityRepository
|
|||
return $qb->getQuery()->getOneOrNullResult();
|
||||
}
|
||||
|
||||
|
||||
public function findSeasonForLodgingBy($lodging, $fromDate)
|
||||
{
|
||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||
$qb->select('s');
|
||||
$qb->from('AppBundle:FewoSeason', 's');
|
||||
$qb->innerJoin('s.prices', 'p');
|
||||
$qb->where($qb->expr()->eq('p.lodging', $lodging->getId()));
|
||||
$qb->andWhere('s.fromDate <= :fromDate');
|
||||
$qb->andWhere('s.toDate >= :fromDate');
|
||||
$qb->setParameter('fromDate', $fromDate);
|
||||
$qb->addOrderBy('s.fromDate', 'DESC');
|
||||
$qb->setMaxResults(1);
|
||||
return $qb->getQuery()->getOneOrNullResult();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue