{ | { | ||||
parent::__construct($repository, 'opening', $paginator); | parent::__construct($repository, 'opening', $paginator); | ||||
} | } | ||||
public function filterByToday() | |||||
{ | |||||
return $this->filterByDay(date('N')); | |||||
} | |||||
public function filterByDay(int $day) | |||||
{ | |||||
return $this->andWhereEqual('day', $day); | |||||
} | |||||
} | } |
{ | { | ||||
return $query; | return $query; | ||||
} | } | ||||
public function getOneToday($query = null) | |||||
{ | |||||
$query = $this->createDefaultQuery($query); | |||||
$query->filterByToday(); | |||||
return $query->findOne(); | |||||
} | |||||
} | } |