mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-10 06:16:11 +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
|
public function listAction(array $search = []): void
|
||||||
{
|
{
|
||||||
|
$demand = $this->demandFactory->fromSettings($this->settings);
|
||||||
if ($search !== []) {
|
if ($search !== []) {
|
||||||
$demand = DateDemand::createFromRequestValues($search, $this->settings);
|
$demand = DateDemand::createFromRequestValues($search, $this->settings);
|
||||||
} elseif (
|
} elseif (
|
||||||
|
@ -91,8 +92,6 @@ class DateController extends AbstractController
|
||||||
|| ($this->request->hasArgument('events_search') && $this->request->getArgument('events_search') != [])
|
|| ($this->request->hasArgument('events_search') && $this->request->getArgument('events_search') != [])
|
||||||
) {
|
) {
|
||||||
$demand = $this->createDemandFromSearch();
|
$demand = $this->createDemandFromSearch();
|
||||||
} else {
|
|
||||||
$demand = $this->demandFactory->fromSettings($this->settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$event = $this->eventDispatcher->dispatch(new DateListVariables(
|
$event = $this->eventDispatcher->dispatch(new DateListVariables(
|
||||||
|
@ -129,9 +128,14 @@ class DateController extends AbstractController
|
||||||
'considerDate' => $arguments['considerDate'] ?? '',
|
'considerDate' => $arguments['considerDate'] ?? '',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$demand = $this->demandFactory->fromSettings($this->settings);
|
||||||
|
if ($search !== []) {
|
||||||
|
$demand = DateDemand::createFromRequestValues($search, $this->settings);
|
||||||
|
}
|
||||||
|
|
||||||
$event = $this->eventDispatcher->dispatch(new DateSearchVariables(
|
$event = $this->eventDispatcher->dispatch(new DateSearchVariables(
|
||||||
$search,
|
$search,
|
||||||
DateDemand::createFromRequestValues($arguments, $this->settings),
|
$demand,
|
||||||
$this->regionRepository->findAll(),
|
$this->regionRepository->findAll(),
|
||||||
$this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['categoriesParent'] ?? 0, 'categories'),
|
$this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['categoriesParent'] ?? 0, 'categories'),
|
||||||
$this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['featuresParent'] ?? 0, 'features')
|
$this->categoryRepository->findAllCurrentlyAssigned($this->settings['uids']['featuresParent'] ?? 0, 'features')
|
||||||
|
|
Loading…
Reference in a new issue