Browse Source

Merge branch 'develop' of https://forge.laclic.fr/Laclic/CaracoleBundle into develop

packProduct
Fabien Normand 3 years ago
parent
commit
e0dcc93b11
2 changed files with 18 additions and 0 deletions
  1. +11
    -0
      Repository/Section/OpeningRepositoryQuery.php
  2. +7
    -0
      Repository/Section/OpeningStore.php

+ 11
- 0
Repository/Section/OpeningRepositoryQuery.php View File

{ {
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);
}

} }

+ 7
- 0
Repository/Section/OpeningStore.php View File

{ {
return $query; return $query;
} }

public function getOneToday($query = null)
{
$query = $this->createDefaultQuery($query);
$query->filterByToday();
return $query->findOne();
}
} }

Loading…
Cancel
Save