OXID eShop CE  4.8.12
 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 {
16  public function __construct()
17  {
19  $this->_sTableName = 'oxartextends';
20  }
21 
31  protected function _preSaveObject($oShopObject, $aData)
32  {
33  return true;
34  }
35 
44  public function saveObject($aData, $blAllowCustomShopId)
45  {
46  $oShopObject = oxNew('oxi18n');
47  $oShopObject->init('oxartextends');
48  $oShopObject->setLanguage( 0 );
49  $oShopObject->setEnableMultilang(false);
50 
51  foreach ($aData as $key => $value) {
52  // change case to UPPER
53  $sUPKey = strtoupper($key);
54  if (!isset($aData[$sUPKey])) {
55  unset($aData[$key]);
56  $aData[$sUPKey] = $value;
57  }
58  }
59 
60 
61  $blLoaded = false;
62  if ($aData['OXID']) {
63  $blLoaded = $oShopObject->load( $aData['OXID']);
64  }
65 
66  $aData = $this->_preAssignObject( $oShopObject, $aData, $blAllowCustomShopId );
67 
68  if ($blLoaded) {
69  $this->checkWriteAccess($oShopObject, $aData);
70  } else {
71  $this->checkCreateAccess($aData);
72  }
73 
74  $oShopObject->assign( $aData );
75 
76  if ($blAllowCustomShopId) {
77  $oShopObject->setIsDerived(false);
78  }
79 
80  if ($this->_preSaveObject($oShopObject, $aData)) {
81  // store
82  if ( $oShopObject->save()) {
83  return $this->_postSaveObject($oShopObject, $aData);
84  }
85  }
86 
87  return false;
88  }
89 }