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