<?php
namespace Entrepreneurs\Bundle\AppBundle\Propel;
use Entrepreneurs\Bundle\AppBundle\Propel\Base\PeriodeInterventionQuery as BasePeriodeInterventionQuery;
use Propel\Runtime\ActiveQuery\Criteria;
class PeriodeInterventionQuery extends BasePeriodeInterventionQuery
{
/**
* @throws \Exception
*/
public function filterByDateDebut($dateDebut = null, $comparison = Criteria::GREATER_EQUAL): self
{
if (!$dateDebut) {
return $this;
}
if ($dateDebut instanceof \DateTime) {
$dateDebut = clone $dateDebut;
} else {
$dateDebut = new \DateTime($dateDebut);
}
$dateDebut->setTime(0, 0);
return parent::filterByDateDebut($dateDebut, $comparison);
}
/**
* @throws \Exception
*/
public function filterByDateFin($dateFin = null, $comparison = Criteria::LESS_EQUAL): self
{
if (!$dateFin) {
return $this;
}
if ($dateFin instanceof \DateTime) {
$dateFin = clone $dateFin;
} else {
$dateFin = new \DateTime($dateFin);
}
$dateFin->setTime(23, 59, 59);
return parent::filterByDateFin($dateFin, $comparison);
}
}