/**
  * getModelPages
  * @return Model_Pages
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 protected function getModelPages()
 {
     if (null === $this->objModelPages) {
         /**
          * 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 . 'cms/models/Pages.php';
         $this->objModelPages = new Model_Pages();
         $this->objModelPages->setLanguageId($this->objElement->Setup()->getLanguageId());
     }
     return $this->objModelPages;
 }
Beispiel #2
0
 /**
  * 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->objElement->Setup()->getModelSubPath() . (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;
             $this->objModel = new Model_Pages();
             $this->objModel->setLanguageId($this->objElement->Setup()->getLanguageId());
         } else {
             throw new Exception('Not able to load type specific model, because the file didn\'t exist! - strType: "' . $this->strType . '"');
         }
     }
     return $this->objModel;
 }