OXID eShop CE  4.9.7
 All Classes Files Functions Variables Pages
oxerptype_artextends.php
Go to the documentation of this file.
1 <?php
2 
3 
4 require_once 'oxerptype.php';
5 
10 {
11 
17  public function __construct()
18  {
20  $this->_sTableName = 'oxartextends';
21  }
22 
32  protected function _preSaveObject($oShopObject, $aData)
33  {
34  return true;
35  }
36 
45  public function saveObject($aData, $blAllowCustomShopId)
46  {
47  $oShopObject = oxNew('oxi18n');
48  $oShopObject->init('oxartextends');
49  $oShopObject->setLanguage(0);
50  $oShopObject->setEnableMultilang(false);
51 
52  foreach ($aData as $key => $value) {
53  // change case to UPPER
54  $sUPKey = strtoupper($key);
55  if (!isset($aData[$sUPKey])) {
56  unset($aData[$key]);
57  $aData[$sUPKey] = $value;
58  }
59  }
60 
61 
62  $blLoaded = false;
63  if ($aData['OXID']) {
64  $blLoaded = $oShopObject->load($aData['OXID']);
65  }
66 
67  $aData = $this->_preAssignObject($oShopObject, $aData, $blAllowCustomShopId);
68 
69  if ($blLoaded) {
70  $this->checkWriteAccess($oShopObject, $aData);
71  } else {
72  $this->checkCreateAccess($aData);
73  }
74 
75  $oShopObject->assign($aData);
76 
77  if ($blAllowCustomShopId) {
78  $oShopObject->setIsDerived(false);
79  }
80 
81  if ($this->_preSaveObject($oShopObject, $aData)) {
82  // store
83  if ($oShopObject->save()) {
84  return $this->_postSaveObject($oShopObject, $aData);
85  }
86  }
87 
88  return false;
89  }
90 }