/** * getEventsContainer * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getEventsContainer($intQuarter = 0, $intYear = 0) { try { $arrContainer = array(); $arrGenForms = array(); $arrPageEntries = array(); $arrPageIds = array(); $counter = 0; $objContainer = new PageContainer(); $objEntries = $this->getPagesByTemplate($this->core->sysConfig->page_types->page->event_templateId, $intQuarter, $intYear); if (count($objEntries) > 0) { foreach ($objEntries as $objEntryData) { $objEntry = new PageEntry(); $objEntry->setEntryId($objEntryData->id); $objEntry->title = $objEntryData->title; $objEntry->url = '/' . strtolower($objEntryData->languageCode) . '/' . $objEntryData->url; $objEntry->datetime = $objEntryData->datetime; $arrGenForms[$objEntryData->genericFormId . '-' . $objEntryData->version][] = $objEntryData->id; $arrPageEntries[$objEntryData->id] = $counter; $objContainer->addPageEntry($objEntry, 'entry_' . $objEntryData->id); } $arrContainer[$counter] = $objContainer; $counter++; } /** * get data of instance tables */ if (count($arrGenForms) > 0) { foreach ($arrGenForms as $key => $arrPageIds) { $arrGenFormPageIds = array(); if (count($arrPageIds) > 0) { foreach ($arrPageIds as $value) { array_push($arrGenFormPageIds, $value); } } $objPageRowset = $this->objModelPages->loadsInstanceDataByIds($key, $arrGenFormPageIds); /** * overwrite page entries */ if (isset($objPageRowset) && count($objPageRowset) > 0) { foreach ($objPageRowset as $objPageRow) { if (array_key_exists($objPageRow->id, $arrPageEntries)) { if (array_key_exists($arrPageEntries[$objPageRow->id], $arrContainer)) { $objPageEntry = $arrContainer[$arrPageEntries[$objPageRow->id]]->getPageEntry('entry_' . $objPageRow->id); $objPageEntry->shortdescription = isset($objPageRow->shortdescription) ? $objPageRow->shortdescription : ''; $objPageEntry->description = isset($objPageRow->description) ? $objPageRow->description : ''; $objPageEntry->event_status = isset($objPageRow->event_status) ? $objPageRow->event_status : ''; $objPageEntry->filename = isset($objPageRow->filename) ? $objPageRow->filename : ''; $objPageEntry->filetitle = isset($objPageRow->filetitle) ? $objPageRow->filetitle : ''; $arrContainer[$arrPageEntries[$objPageRow->id]]->addPageEntry($objPageEntry, 'entry_' . $objPageRow->id); } } } } } } return $arrContainer; } catch (Exception $exc) { $this->core->logger->err($exc); } }
/** * getEventsContainer * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function getEventsContainer($intQuarter = 0, $intYear = 0) { try { $this->arrContainer = array(); $this->arrGenForms = array(); $this->arrPageEntries = array(); $arrPageIds = array(); $counter = 0; $objContainer = new PageContainer(); $objEntries = $this->getPagesByTemplate($this->core->sysConfig->page_types->page->event_templateId, $intQuarter, $intYear); if (count($objEntries) > 0) { foreach ($objEntries as $objEntryData) { $objEntry = new PageEntry(); $objEntry->setEntryId($objEntryData->id); $objEntry->title = $objEntryData->title; $objEntry->url = '/' . strtolower($objEntryData->languageCode) . '/' . $objEntryData->url; $objEntry->datetime = $objEntryData->datetime; $this->arrGenForms[$objEntryData->genericFormId . '-' . $objEntryData->version][] = $objEntryData->id; $this->arrPageEntries[$objEntryData->id] = $counter; $objContainer->addPageEntry($objEntry, 'entry_' . $objEntryData->id); } $this->arrContainer[$counter] = $objContainer; $counter++; } /** * get data of instance tables */ if (count($this->arrGenForms) > 0) { $this->loadInstanceData(); } return $this->arrContainer; } catch (Exception $exc) { $this->core->logger->err($exc); } }