mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-22 04:16:10 +01:00
Streamline creation of demand within date controller
This commit is contained in:
parent
69ac00823b
commit
9678884de4
1 changed files with 7 additions and 3 deletions
|
@ -81,6 +81,7 @@ class DateController extends AbstractController
|
|||
*/
|
||||
public function listAction(array $search = []): void
|
||||
{
|
||||
$demand = $this->demandFactory->fromSettings($this->settings);
|
||||
if ($search !== []) {
|
||||
$demand = DateDemand::createFromRequestValues($search, $this->settings);
|
||||
} elseif (
|
||||
|
@ -91,8 +92,6 @@ class DateController extends AbstractController
|
|||
|| ($this->request->hasArgument('events_search') && $this->request->getArgument('events_search') != [])
|
||||
) {
|
||||
$demand = $this->createDemandFromSearch();
|
||||
} else {
|
||||
$demand = $this->demandFactory->fromSettings($this->settings);
|
||||
}
|
||||
|
||||
$event = $this->eventDispatcher->dispatch(new DateListVariables(
|
||||
|
@ -129,9 +128,14 @@ class DateController extends AbstractController
|
|||
'considerDate' => $arguments['considerDate'] ?? '',
|
||||
]);
|
||||
|
||||
$demand = $this->demandFactory->fromSettings($this->settings);
|
||||
if ($search !== []) {
|
||||
$demand = DateDemand::createFromRequestValues($search, $this->settings);
|
||||
}
|
||||
|
||||
$event = $this->eventDispatcher->dispatch(new DateSearchVariables(
|
||||
$search,
|
||||
DateDemand::createFromRequestValues($arguments, $this->settings),
|
||||
$demand,
|
||||
$this->regionRepository->findAll(),
|
||||
$this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['categoriesParent'] ?? 0, 'categories'),
|
||||
$this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['featuresParent'] ?? 0, 'features')
|
||||
|
|
Loading…
Reference in a new issue