/** * changeParentRootFolderId * @param integer $intPageId * @param integer $intRootFolderId * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function changeParentRootFolderId($intPageId, $intRootFolderId) { $this->core->logger->debug('cms->models->Model_Pages->changeParentRootFolderId(' . $intPageId . ',' . $intRootFolderId . ')'); try { $this->getPageTable(); $strWhere = $this->objPageTable->getAdapter()->quoteInto('id = ?', $intPageId); $this->objPageTable->update(array('idParent' => $intRootFolderId, 'idParentTypes' => $this->core->sysConfig->parent_types->rootlevel), $strWhere); } catch (Exception $exc) { $this->core->logger->err($exc); } }
/** * updateStartPageMainData * @param integer $intFolderId * @param array $arrProperties * @param string $strTitle * @author Thomas Schedler <*****@*****.**> * @version 1.0 */ public function updateStartPageMainData($intFolderId, $arrProperties, $arrTitle) { $objSelect = $this->getPageTable()->select(); $objSelect->from($this->objPageTable, array('pageId', 'version')); $objSelect->where('idParent = ?', $intFolderId)->where('idParentTypes = ?', $this->core->sysConfig->parent_types->folder)->where('isStartPage = 1'); $objSelect->order(array('version DESC')); $objSelect->limit(1); $objStartPageData = $this->objPageTable->fetchAll($objSelect); if (count($objStartPageData) > 0) { $objStartPage = $objStartPageData->current(); $strWhere = $this->objPageTable->getAdapter()->quoteInto('pageId = ?', $objStartPage->pageId); $strWhere .= $this->objPageTable->getAdapter()->quoteInto(' AND version = ?', $objStartPage->version); $this->objPageTable->update($arrProperties, $strWhere); $strWhere .= $this->objPageTable->getAdapter()->quoteInto(' AND idLanguages = ?', $this->intLanguageId); $intNumOfEffectedRows = $this->core->dbh->update('pageTitles', $arrTitle, $strWhere); if ($intNumOfEffectedRows == 0) { $arrTitle = array_merge($arrTitle, array('pageId' => $objStartPage->pageId, 'version' => $objStartPage->version, 'idLanguages' => $this->intLanguageId)); $this->core->dbh->insert('pageTitles', $arrTitle); } } }