oxerptype_artextends.php

Go to the documentation of this file.
00001 <?php
00002 
00003 
00004 require_once 'oxerptype.php';
00005 
00009 class oxERPType_Artextends extends oxERPType
00010 {
00011 
00017     public function __construct()
00018     {
00019         parent::__construct();
00020         $this->_sTableName = 'oxartextends';
00021     }
00022 
00032     protected function _preSaveObject($oShopObject, $aData)
00033     {
00034         return true;
00035     }
00036 
00045     public function saveObject($aData, $blAllowCustomShopId)
00046     {
00047         $oShopObject = oxNew('oxi18n');
00048         $oShopObject->init('oxartextends');
00049         $oShopObject->setLanguage(0);
00050         $oShopObject->setEnableMultilang(false);
00051 
00052         foreach ($aData as $key => $value) {
00053             // change case to UPPER
00054             $sUPKey = strtoupper($key);
00055             if (!isset($aData[$sUPKey])) {
00056                 unset($aData[$key]);
00057                 $aData[$sUPKey] = $value;
00058             }
00059         }
00060 
00061 
00062         $blLoaded = false;
00063         if ($aData['OXID']) {
00064             $blLoaded = $oShopObject->load($aData['OXID']);
00065         }
00066 
00067         $aData = $this->_preAssignObject($oShopObject, $aData, $blAllowCustomShopId);
00068 
00069         if ($blLoaded) {
00070             $this->checkWriteAccess($oShopObject, $aData);
00071         } else {
00072             $this->checkCreateAccess($aData);
00073         }
00074 
00075         $oShopObject->assign($aData);
00076 
00077         if ($blAllowCustomShopId) {
00078             $oShopObject->setIsDerived(false);
00079         }
00080 
00081         if ($this->_preSaveObject($oShopObject, $aData)) {
00082             // store
00083             if ($oShopObject->save()) {
00084                 return $this->_postSaveObject($oShopObject, $aData);
00085             }
00086         }
00087 
00088         return false;
00089     }
00090 }