/**
  * Search view
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Dto\SearchDemand $searchDemand SearchDemand
  * @param array $overwriteDemand OverwriteDemand
  *
  * @return void
  */
 public function searchAction(SearchDemand $searchDemand = null, array $overwriteDemand = [])
 {
     $eventDemand = $this->createEventDemandObjectFromSettings($this->settings);
     $eventDemand->setSearchDemand($searchDemand);
     $foreignRecordDemand = $this->createForeignRecordDemandObjectFromSettings($this->settings);
     $categoryDemand = $this->createCategoryDemandObjectFromSettings($this->settings);
     if ($searchDemand !== null) {
         $searchDemand->setFields($this->settings['search']['fields']);
         if ($this->settings['search']['adjustTime'] && $searchDemand->getStartDate() !== null) {
             $searchDemand->getStartDate()->setTime(0, 0, 0);
         }
         if ($this->settings['search']['adjustTime'] && $searchDemand->getEndDate() !== null) {
             $searchDemand->getEndDate()->setTime(23, 59, 59);
         }
     }
     if ($this->isOverwriteDemand($overwriteDemand)) {
         $eventDemand = $this->overwriteEventDemandObject($eventDemand, $overwriteDemand);
     }
     $categories = $this->categoryRepository->findDemanded($categoryDemand);
     $locations = $this->locationRepository->findDemanded($foreignRecordDemand);
     $events = $this->eventRepository->findDemanded($eventDemand);
     $this->view->assign('events', $events);
     $this->view->assign('categories', $categories);
     $this->view->assign('locations', $locations);
     $this->view->assign('searchDemand', $searchDemand);
     $this->view->assign('overwriteDemand', $overwriteDemand);
 }
 /**
  * Test if limit restriction works
  *
  * @test
  * @return void
  */
 public function findDemandedRecordsSetsLimit()
 {
     /** @var \DERHANSEN\SfEventMgt\Domain\Model\Dto\EventDemand $demand */
     $demand = $this->objectManager->get('DERHANSEN\\SfEventMgt\\Domain\\Model\\Dto\\EventDemand');
     $demand->setStoragePage(4);
     $demand->setDisplayMode('all');
     $demand->setQueryLimit(2);
     $events = $this->eventRepository->findDemanded($demand);
     $this->assertEquals(2, $events->count());
 }
 /**
  * List view
  *
  * @param array $overwriteDemand OverwriteDemand
  *
  * @return void
  */
 public function listAction(array $overwriteDemand = NULL)
 {
     $demand = $this->createDemandObjectFromSettings($this->settings);
     if ($this->settings['disableOverrideDemand'] != 1 && $overwriteDemand !== NULL) {
         $demand = $this->overwriteDemandObject($demand, $overwriteDemand);
     }
     $events = $this->eventRepository->findDemanded($demand);
     $categories = $this->categoryRepository->findAll();
     $locations = $this->locationRepository->findAll();
     $this->view->assign('events', $events);
     $this->view->assign('categories', $categories);
     $this->view->assign('locations', $locations);
     $this->view->assign('overwriteDemand', $overwriteDemand);
 }
 /**
  * List action for backend module
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Dto\EventDemand $demand Demand
  * @param int $messageId MessageID
  *
  * @return void
  */
 public function listAction(EventDemand $demand = NULL, $messageId = NULL)
 {
     if ($demand === NULL) {
         $demand = $this->objectManager->get('DERHANSEN\\SfEventMgt\\Domain\\Model\\Dto\\EventDemand');
     }
     if ($this->pid > 0) {
         $demand->setStoragePage($this->pid);
     }
     if ($messageId !== NULL && is_numeric($messageId)) {
         $this->view->assign('showMessage', TRUE);
         $this->view->assign('messageTitleKey', 'administration.message-' . $messageId . '.title');
         $this->view->assign('messageContentKey', 'administration.message-' . $messageId . '.content');
     }
     $events = $this->eventRepository->findDemanded($demand);
     $this->view->assign('events', $events);
     $this->view->assign('demand', $demand);
 }
 /**
  * List action for backend module
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Dto\SearchDemand $searchDemand SearchDemand
  * @param int $messageId MessageID
  *
  * @return void
  */
 public function listAction(SearchDemand $searchDemand = null, $messageId = null)
 {
     /** @var EventDemand $demand */
     $demand = $this->objectManager->get('DERHANSEN\\SfEventMgt\\Domain\\Model\\Dto\\EventDemand');
     if ($searchDemand !== null) {
         $searchDemand->setFields($this->settings['search']['fields']);
     }
     $demand->setSearchDemand($searchDemand);
     if ($this->pid > 0) {
         $demand->setStoragePage($this->pid);
     }
     if ($messageId !== null && is_numeric($messageId)) {
         $this->view->assign('showMessage', true);
         $this->view->assign('messageTitleKey', 'administration.message-' . $messageId . '.title');
         $this->view->assign('messageContentKey', 'administration.message-' . $messageId . '.content');
     }
     $events = $this->eventRepository->findDemanded($demand);
     $this->view->assign('events', $events);
     $this->view->assign('searchDemand', $searchDemand);
 }