Exemplo n.º 1
0
 /**
  * load()
  * @param integer $intElementId
  * @param string $strType
  * @param string $strElementId
  * @param integet $intVersion
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 public function load($intElementId, $strType, $strElementId = null, $intVersion = null)
 {
     try {
         $this->strType = $strType;
         $this->getModel();
         $this->getModelUrls();
         $objItemData = $this->objModel->load($intElementId);
         if (count($objItemData) > 0) {
             $objItem = $objItemData->current();
             $objUrlData = $this->objModelUrls->loadUrl($objItem->relationId, $objItem->version, $this->core->sysConfig->url_types->{$strType});
             if (count($objUrlData) > 0) {
                 $objUrl = $objUrlData->current();
                 $this->objElement->setValue('/' . strtolower($objUrl->languageCode) . '/' . $objUrl->url);
                 $this->objElement->url = $objUrl->url;
                 $this->objElement->blnIsStartElement = $this->objElement->Setup()->getIsStartElement(false);
                 $this->objElement->intParentId = $this->objElement->Setup()->getParentId();
             }
         }
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
     }
 }