init without trunk

This commit is contained in:
Kevin Adametz 2020-07-09 12:49:32 +02:00
parent ed24ac4994
commit bb809e7233
14652 changed files with 177862 additions and 94817 deletions

View file

@ -1,47 +0,0 @@
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Query\Expr\OrderBy;
/**
* FewoLodgingRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class FewoLodgingRepository extends \Doctrine\ORM\EntityRepository
{
/**
* @param FewoLodging $lodging
*
* @return FewoSeason|null
*/
public function findLatestSeasonEndForLodging($lodging)
{
$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->addOrderBy('s.toDate', 'DESC');
$qb->setMaxResults(1);
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();
}
}