private function checkDayValue($day) { $noDays = $this->listing->getNumberOfDaysInMonth(); if (!is_numeric($day) or !($day >= 1 and $day <= $noDays)) { $this->redirect('this'); } }
public function render() { $template = $this->getTemplate(); $template->setFile(__DIR__ . '/templates/table.latte'); if (!$this->presenter->isAjax()) { $this->items = $this->itemFacade->generateEntireTable($this->listing); } else { $this->items = $this->itemFacade->prepareDisplayableItemsCollection($this->items); } $template->itemsCollection = $this->items; $template->workedDays = $this->workedDays; $template->totalWorkedHours = $this->totalWorkedHours; $template->isTableCaptionVisible = $this->isTableCaptionVisible; $template->showCheckBoxes = $this->showCheckBoxes; $template->showActions = $this->showActions; $template->parameters = $this->parameters; $template->listing = $this->listing; $template->numberOfDaysInMonth = $this->listing->getNumberOfDaysInMonth(); $template->render(); }
/** * @param Listing $listing */ public function setListing(Listing $listing) { $listingDaysInMonth = $listing->getNumberOfDaysInMonth(); if (isset($this->day) and $this->day > $listingDaysInMonth) { throw new InvalidArgumentException('Day of ListingItem exceed last day in Listing period.'); } $this->listing = $listing; }