/**
  * @return void
  */
 public function listNewestAction()
 {
     $args = $this->request->getArguments();
     if (isset($args['category'])) {
     } else {
         $leisures = $this->leisureRepository->findNewestSorting($this->settings['sorting'], $this->settings['limit']);
     }
     $this->view->assign('leisures', $leisures);
     $this->view->assign('imagePath', $this->settings['leisureImagePath']);
     $this->view->assign('detailPage', $this->settings['detailPage']);
 }
 /**
  * called by ajax. so we have to build leisure from repository and can't use normal paradigma per parameter
  */
 public function showReservationsAction()
 {
     /** @var $leisure \MUM\BjrFreizeit\Domain\Model\Leisure  */
     $leisure = $this->leisureRepository->findByUid($this->request->getArgument('leisure'));
     $reservations = $this->reservationRepository->findByArticle($leisure);
     $reservedDates = array();
     /* @var $reservation \Bjr\BjrLend\Domain\Model\Reservation  */
     foreach ($reservations->toArray() as $reservation) {
         $list = $reservation->listIssueDays();
         //DebuggerUtility::var_dump($list, 'List');
         foreach ($list as $dateTime) {
             $month = date('n', $dateTime);
             $day = date('j', $dateTime);
             $reservedDates[] = array('month' => $month, 'day' => $day);
         }
     }
     $params = array('reservations' => $reservations, 'reservedDates' => json_encode($reservedDates), 'leisure' => $leisure);
     $renderer = $this->getPlainRenderer('ShowReservations', 'html');
     $renderer->assignMultiple($params);
     $content = $renderer->render();
     //DebuggerUtility::var_dump($leisure, 'Leisure');
     //DebuggerUtility::var_dump($reservations, 'Reservations');
     return $content;
     //$this->view->assignMultiple($params);
 }
 protected function getSelectLocationList()
 {
     $rawList = $this->leisureRepository->findAllLocations(true);
     $selectList = array();
     if (count($rawList) > 0) {
         foreach ($rawList as $location) {
             $selectList[] = array('name' => $location['location']);
         }
     }
     return $selectList;
 }