/** * getModel * @return type Model * @author Thomas Schedler <*****@*****.**> * @version 1.0 */ protected function getModel() { if ($this->objModel === null) { /** * autoload only handles "library" compoennts. * Since this is an application model, we need to require it * from its modules path location. */ $strModelFilePath = GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . $this->strModelSubPath . (substr($this->strType, strlen($this->strType) - 1) == 'y' ? ucfirst(rtrim($this->strType, 'y')) . 'ies' : ucfirst($this->strType) . 's') . '.php'; if (file_exists($strModelFilePath)) { require_once $strModelFilePath; $strModel = 'Model_' . (substr($this->strType, strlen($this->strType) - 1) == 'y' ? ucfirst(rtrim($this->strType, 'y')) . 'ies' : ucfirst($this->strType) . 's'); $this->objModel = new $strModel(); $this->objModel->setLanguageId($this->getRequest()->getParam("languageId", $this->core->intZooluLanguageId)); } else { throw new Exception('Not able to load type specific model, because the file didn\'t exist! - strType: "' . $this->strType . '"'); } } return $this->objModel; }