Ejemplo n.º 1
0
 /**
  * List action
  *
  * @param \HDNET\Calendarize\Domain\Model\Index $index
  * @param \DateTime                             $startDate
  * @param \DateTime                             $endDate
  * @param array                                 $customSearch *
  * @param int                                   $year
  * @param int                                   $month
  * @param int                                   $week
  *
  * @ignorevalidation $startDate
  * @ignorevalidation $endDate
  * @ignorevalidation $customSearch
  *
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
  */
 public function listAction(Index $index = NULL, \DateTime $startDate = NULL, \DateTime $endDate = NULL, array $customSearch = array(), $year = NULL, $month = NULL, $week = NULL)
 {
     if ($index instanceof Index && in_array('detail', $this->getAllowedActions())) {
         $this->forward('detail');
     }
     $searchMode = FALSE;
     if ($startDate || $endDate || $customSearch) {
         $searchMode = TRUE;
         $indices = $this->indexRepository->findBySearch($startDate, $endDate, $customSearch);
     } elseif (MathUtility::canBeInterpretedAsInteger($year) && MathUtility::canBeInterpretedAsInteger($month)) {
         $indices = $this->indexRepository->findMonth($year, $month);
     } elseif (MathUtility::canBeInterpretedAsInteger($year) && MathUtility::canBeInterpretedAsInteger($week)) {
         $indices = $this->indexRepository->findWeek($year, $week);
     } elseif (MathUtility::canBeInterpretedAsInteger($year)) {
         $indices = $this->indexRepository->findYear($year);
     } else {
         $indices = $this->indexRepository->findList((int) $this->settings['limit']);
     }
     $this->view->assignMultiple(array('indices' => $indices, 'searchMode' => $searchMode));
 }
 /**
  * List action
  *
  * @param \HDNET\Calendarize\Domain\Model\Index $index
  * @param \DateTime                             $startDate
  * @param \DateTime                             $endDate
  * @param array                                 $customSearch *
  * @param int                                   $year
  * @param int                                   $month
  * @param int                                   $day
  * @param int                                   $week
  *
  * @ignorevalidation $startDate
  * @ignorevalidation $endDate
  * @ignorevalidation $customSearch
  *
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
  */
 public function listAction(Index $index = null, \DateTime $startDate = null, \DateTime $endDate = null, array $customSearch = [], $year = null, $month = null, $day = null, $week = null)
 {
     $this->checkStaticTemplateIsIncluded();
     if ($index instanceof Index && in_array('detail', $this->getAllowedActions())) {
         $this->forward('detail');
     }
     $searchMode = false;
     if ($startDate || $endDate || $customSearch) {
         $searchMode = true;
         $indices = $this->indexRepository->findBySearch($startDate, $endDate, $customSearch);
     } elseif (MathUtility::canBeInterpretedAsInteger($year) && MathUtility::canBeInterpretedAsInteger($month) && MathUtility::canBeInterpretedAsInteger($day)) {
         $indices = $this->indexRepository->findDay($year, $month, $day);
     } elseif (MathUtility::canBeInterpretedAsInteger($year) && MathUtility::canBeInterpretedAsInteger($month)) {
         $indices = $this->indexRepository->findMonth($year, $month);
     } elseif (MathUtility::canBeInterpretedAsInteger($year) && MathUtility::canBeInterpretedAsInteger($week)) {
         $indices = $this->indexRepository->findWeek($year, $week);
     } elseif (MathUtility::canBeInterpretedAsInteger($year)) {
         $indices = $this->indexRepository->findYear($year);
     } else {
         $indices = $this->indexRepository->findList((int) $this->settings['limit']);
     }
     $this->slotExtendedAssignMultiple(['indices' => $indices, 'searchMode' => $searchMode], __CLASS__, __FUNCTION__);
 }