public function render()
 {
     $template = $this->getTemplate();
     $template->setFile(__DIR__ . '/templates/template.latte');
     if ($this->presenter->getParameter('month') !== null) {
         $this->template->date = new \DateTime($this->presenter->getParameter('year') . '-' . $this->presenter->getParameter('month') . '-01');
     }
     $template->heading = $this->heading;
     $template->numberOfListings = isset($this->listings) ? Arrays::count_recursive($this->listings, 1) : 0;
     $template->listings = $this->listings;
     $template->render();
 }
 public function render()
 {
     $template = $this->getTemplate();
     $template->setFile(__DIR__ . '/templates/template.latte');
     if ($this->listingsQuery->getMonth() !== null) {
         $this->template->date = new \DateTime($this->listingsQuery->getYear() . '-' . $this->listingsQuery->getMonth() . '-01');
     }
     $this->listings = $this->prepareListings($this->listingsFacade->fetchListings($this->listingsQuery)->toArray(AbstractQuery::HYDRATE_SCALAR));
     $template->heading = $this->heading;
     $template->numberOfListings = isset($this->listings) ? Arrays::count_recursive($this->listings, 1) : 0;
     $template->listings = $this->listings;
     $template->render();
 }
Example #3
0
 /**
  * @param array $workedHours
  * @return bool
  */
 private function compareWithArrayOfValues(array $workedHours)
 {
     $members = Arrays::pickMembers($workedHours, ['workStart', 'workEnd', 'lunch', 'otherHours']);
     foreach ($members as $propertyName => $value) {
         if ($this->{$propertyName}->compare(new InvoiceTime($value)) !== 0) {
             return false;
         }
     }
     return true;
 }