/** * updateFileData * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function updateFileData() { $this->core->logger->debug('massiveart.files.File->updateFileData()'); try { $arrMetaData = array(); $this->getModelFile(); $strTmpEditFileIds = trim($this->arrFileDatas['EditFileIds'], '[]'); $arrEditFileIds = array(); $arrEditFileIds = split('\\]\\[', $strTmpEditFileIds); if (count($arrEditFileIds) > 0) { foreach ($arrEditFileIds as $intEditFileId) { if ($intEditFileId != '') { $intLanguageId = 1; // TODO : language $strFileTitle = $this->arrFileDatas['FileTitle' . $intEditFileId . '|||' . $intLanguageId]; $strFileDescription = $this->arrFileDatas['FileDescription' . $intEditFileId . '|||' . $intLanguageId]; $strWhere = $this->objModelFile->getFileTitleTable()->getAdapter()->quoteInto('idFiles = ?', $intEditFileId); $strWhere .= $this->objModelFile->getFileTitleTable()->getAdapter()->quoteInto(' AND idLanguages = ?', $intLanguageId); $intNumOfEffectedRows = $this->objModelFile->getFileTitleTable()->update(array('title' => $strFileTitle, 'description' => $strFileDescription, 'changed' => date('Y-m-d H:i:s')), $strWhere); if ($intNumOfEffectedRows == 0) { $this->saveFileData($arrEditFileIds); } } } } } catch (Exception $exc) { $this->core->logger->err($exc); } }
/** * getModelFiles * @return Model_Files * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ protected function getModelFiles() { if (null === $this->objModelFiles) { require_once GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . 'core/models/Files.php'; $this->objModelFiles = new Model_Files(); $this->objModelFiles->setLanguageId($this->intLanguageId); } return $this->objModelFiles; }
/** * getModelFiles * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ protected function getModelFiles() { if (null === $this->objModelFiles) { /** * autoload only handles "library" compoennts. * Since this is an application model, we need to require it * from its modules path location. */ require_once GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . 'core/models/Files.php'; $this->objModelFiles = new Model_Files(); $this->objModelFiles->setLanguageId($this->setup->getLanguageId()); } return $this->objModelFiles; }
/** * getModelFiles * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ protected function getModelFiles() { if (null === $this->objModelFiles) { /** * autoload only handles "library" compoennts. * Since this is an application model, we need to require it * from its modules path location. */ require_once GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . 'core/models/Files.php'; $this->objModelFiles = new Model_Files(); $this->objModelFiles->setLanguageId($this->getRequest()->getParam("languageId", $this->core->intZooluLanguageId)); $this->objModelFiles->setAlternativLanguageId(Zend_Auth::getInstance()->getIdentity()->languageId); } return $this->objModelFiles; }