/** * Sets data field value * * @param string $sFieldName index OR name (eg. 'oxarticles__oxtitle') of a data field to set * @param string $sValue value of data field * @param int $iDataType field type * * @return null */ protected function _setFieldData($sFieldName, $sValue, $iDataType = oxField::T_TEXT) { if ('oxurldesc' === strtolower($sFieldName) || 'oxlinks__oxurldesc' === strtolower($sFieldName)) { $iDataType = oxField::T_RAW; } return parent::_setFieldData($sFieldName, $sValue, $iDataType); }
/** * Class constructor, initiates parent constructor (parent::oxBase()), loads * base shop objects. */ public function __construct() { $oConfig = $this->getConfig(); $this->setWrappingVat($oConfig->getConfigParam('dDefaultVAT')); $this->setWrappingVatOnTop($oConfig->getConfigParam('blWrappingVatOnTop')); parent::__construct(); $this->init('oxwrapping'); }
/** * Delete this object from the database, returns true on success. * * @param string $sOXID Object ID(default null) * * @return bool */ public function delete($sOXID = null) { if (!$sOXID) { $sOXID = $this->getId(); } if (!$sOXID) { return false; } $oDB = oxDb::getDb(); $oDB->execute('delete from oxobject2discount where oxobject2discount.oxdiscountid = ' . $oDB->quote($sOXID)); return parent::delete($sOXID); }
/** * Delete this object from the database, returns true on success. * * @param string $sOxId Object ID(default null) * * @return bool */ public function delete($sOxId = null) { if (!$sOxId) { $sOxId = $this->getId(); } if (!$sOxId) { return false; } $oDb = oxDb::getDb(); $sOxIdQuoted = $oDb->quote($sOxId); $oDb->execute('delete from oxobject2payment where oxobjectid = ' . $sOxIdQuoted); $oDb->execute('delete from oxobject2delivery where oxdeliveryid = ' . $sOxIdQuoted); $oDb->execute('delete from oxdel2delset where oxdelsetid = ' . $sOxIdQuoted); return parent::delete($sOxId); }
/** * Removes attributes from articles, returns true on success. * * @param string $sOXID Object ID * * @return bool */ public function delete($sOXID = null) { if (!$sOXID) { $sOXID = $this->getId(); } if (!$sOXID) { return false; } // remove attributes from articles also $oDb = oxDb::getDb(); $sOxidQuoted = $oDb->quote($sOXID); $sDelete = "delete from oxobject2attribute where oxattrid = " . $sOxidQuoted; $rs = $oDb->execute($sDelete); // #657 ADDITIONAL removes attribute connection to category $sDelete = "delete from oxcategory2attribute where oxattrid = " . $sOxidQuoted; $rs = $oDb->execute($sDelete); return parent::delete($sOXID); }
/** * Deletes user group from database. Returns true/false, according to deleting status. * * @param string $sOXID Object ID (default null) * * @return bool */ public function delete($sOXID = null) { if (!$sOXID) { $sOXID = $this->getId(); } if (!$sOXID) { return false; } parent::delete($sOXID); $oDb = oxDb::getDb(); // deleting related data records $sDelete = 'delete from oxobject2group where oxobject2group.oxgroupsid = ' . $oDb->quote($sOXID); $rs = $oDb->execute($sDelete); $sDelete = 'delete from oxobject2delivery where oxobject2delivery.oxobjectid = ' . $oDb->quote($sOXID); $rs = $oDb->execute($sDelete); $sDelete = 'delete from oxobject2discount where oxobject2discount.oxobjectid = ' . $oDb->quote($sOXID); $rs = $oDb->execute($sDelete); $sDelete = 'delete from oxobject2payment where oxobject2payment.oxobjectid = ' . $oDb->quote($sOXID); $rs = $oDb->execute($sDelete); return $rs->EOF; }
/** * Executes oxarticle::_skipSaveFields() and updates article information * * @return bool */ protected function _update() { $this->_skipSaveFields(); $myConfig = $this->getConfig(); return parent::_update(); }
/** * Assigns oxwrapping object data and calculates dprice/fprice * * @param array $dbRecord object data * * @return null */ public function assign($dbRecord) { // loading object from database parent::assign($dbRecord); // setting image path $myConfig = $this->getConfig(); }
/** * Delete this object from the database, returns true on success. * * @param string $sOXID Object ID(default null) * * @return bool */ public function delete($sOXID = null) { if (parent::delete($sOXID)) { oxSeoEncoderVendor::getInstance()->onDeleteVendor($this); return true; } return false; }
/** * Delete this object from the database, returns true on success. * * @param string $sOXID Object ID (default null) * * @return bool */ public function delete($sOXID = null) { if (!$sOXID) { $sOXID = $this->getId(); } if (!$sOXID) { return false; } $oDb = oxDb::getDb(); $sQ = "delete from oxobject2delivery where oxobject2delivery.oxdeliveryid = " . $oDb->quote($sOXID); $oDb->execute($sQ); return parent::delete($sOXID); }
/** * Delete this object from the database, returns true on success. * * @param string $sOxId Object ID (default null) * * @return bool */ public function delete($sOxId = null) { if (!$sOxId) { $sOxId = $this->getId(); } if (!$sOxId) { return false; } $oDb = oxDb::getDb(); $sQ = "delete from `oxobject2delivery` where `oxobject2delivery`.`oxdeliveryid` = " . $oDb->quote($sOxId); $oDb->execute($sQ); return parent::delete($sOxId); }
/** * Save the discount. * Assigns a value to oxsort, if it was null * Does input validation before saving the discount. * * Returns saving status * * @throws \oxInputException * @throws StandardException * * @return bool */ public function save() { // Auto assign oxsort, if it is null $oxsort = $this->oxdiscount__oxsort->value; if (is_null($oxsort)) { $shopId = $this->oxdiscount__oxshopid->value; $newSort = $this->getNextOxsort($shopId); $this->oxdiscount__oxsort = new \oxField($newSort, \oxField::T_RAW); } // Validate oxsort before saving if (!is_numeric($this->oxdiscount__oxsort->value)) { $exception = oxNew('oxInputException'); $exception->setMessage('DISCOUNT_ERROR_OXSORT_NOT_A_NUMBER'); throw $exception; } try { $saveStatus = parent::save(); } catch (\OxidEsales\EshopCommunity\Core\Exception\StandardException $exception) { if ($exception->getCode() == 1062 && false !== strpos($exception->getMessage(), 'UNIQ_OXSORT')) { $exception = oxNew('oxInputException'); $exception->setMessage('DISCOUNT_ERROR_OXSORT_NOT_UNIQUE'); } throw $exception; } return $saveStatus; }
/** * Removes article action, returns true on success. For * performance - you can not load action object - just pass * action ID. * * @param string $sOxId Object ID * * @return bool */ public function delete($sOxId = null) { if (!$sOxId) { $sOxId = $this->getId(); } if (!$sOxId) { return false; } // remove actionss from articles also $oDb = oxDb::getDb(true); $sDelete = "delete from oxactions2article where oxactionid = " . $oDb->quote($sOxId) . " and oxshopid = '" . $this->getShopId() . "'"; $oDb->execute($sDelete); return parent::delete($sOxId); }
/** * Sets data field value * * @param string $sFieldName index OR name (eg. 'oxarticles__oxtitle') of a data field to set * @param string $sValue value of data field * @param int $iDataType field type * * @return null */ protected function _setFieldData($sFieldName, $sValue, $iDataType = oxField::T_TEXT) { switch (strtolower($sFieldName)) { case 'oxlongdesc': case 'oxnews__oxlongdesc': $iDataType = oxField::T_RAW; break; } return parent::_setFieldData($sFieldName, $sValue, $iDataType); }
/** * Class constructor, initiates parent constructor (parent::oxBase()). */ public function __construct() { parent::__construct(); $this->init('oxshops'); }
/** * Initializes instance * */ public function __construct() { parent::__construct(); $this->_sCacheKey = "simplevariants"; $this->init('oxarticles'); }
/** * Save this Object to database, insert or update as needed. * * @return mixed */ public function save() { $blSaved = parent::save(); if ($blSaved && $this->oxcontents__oxloadid->value === 'oxagb') { $sShopId = $this->getConfig()->getShopId(); $sVersion = $this->oxcontents__oxtermversion->value; $oDb = oxDb::getDb(); // dropping expired.. $oDb->execute("delete from oxacceptedterms where oxshopid='{$sShopId}' and oxtermversion != " . $oDb->quote($sVersion)); } return $blSaved; }
/** * Class constructor, initiates parent constructor (parent::oxBase()). */ public function __construct() { parent::__construct(); $this->init('oxshops'); if ($iMax = $this->getConfig()->getConfigParam('iMaxShopId')) { $this->setMaxShopId($iMax); } }
/** * Executes oxArticle::_skipSaveFields() and updates article information * * @return bool */ protected function _update() { $this->setUpdateSeo(true); $this->_setUpdateSeoOnFieldChange('oxtitle'); $this->_skipSaveFields(); $blRes = parent::_update(); return $blRes; }
/** * Assigns to oxarticle object some base parameters/values (such as * detaillink, moredetaillink, etc). * * @param string $aRecord Array representing current field values */ public function assign($aRecord) { // load object from database parent::assign($aRecord); }
/** * Removes selectlists from articles. * * @param string $sOXID object ID (default null) * * @return bool */ public function delete($sOXID = null) { if (!$sOXID) { $sOXID = $this->getId(); } if (!$sOXID) { return false; } // remove selectlists from articles also if ($blRemove = parent::delete($sOXID)) { $oDb = oxDb::getDb(); $oDb->execute("delete from oxobject2selectlist where oxselnid = " . $oDb->quote($sOXID) . " "); } return $blRemove; }
/** * Delete this object from the database, returns true on success. * * @param string $sOxId Object ID(default null) * * @return bool */ public function delete($sOxId = null) { if (parent::delete($sOxId)) { $sOxId = $sOxId ? $sOxId : $this->getId(); $oDb = oxDb::getDb(); // deleting payment related data $rs = $oDb->execute("delete from oxobject2payment where oxpaymentid = " . $oDb->quote($sOxId)); return $rs->EOF; } return false; }
/** * Deletes record and unlinks the file * * @param string $sOXID Object ID(default null) * * @return bool */ public function delete($sOXID = null) { $sFilePath = $this->getConfig()->getConfigParam('sShopDir') . "/out/media/" . $this->oxmediaurls__oxurl->value; if ($this->oxmediaurls__oxisuploaded->value && file_exists($sFilePath)) { unlink($sFilePath); } return parent::delete($sOXID); }
/** * Class constructor, initiates parent constructor (parent::oxI18n()). */ public function __construct() { parent::__construct(); $this->init('oxcountry'); }
/** * Delete this object from the database, returns true on success. * * @param string $sOXID Object ID(default null) * * @return bool */ public function delete($sOXID = null) { if (parent::delete($sOXID)) { oxRegistry::get("oxSeoEncoderVendor")->onDeleteVendor($this); return true; } return false; }
/** * Sets data field value * * @param string $sFieldName index OR name (eg. 'oxarticles__oxtitle') of a data field to set * @param string $sValue value of data field * @param int $iDataType field type * * @return null */ protected function _setFieldData($sFieldName, $sValue, $iDataType = oxField::T_TEXT) { //preliminary quick check saves 3% of execution time in category lists by avoiding redundant strtolower() call if ($sFieldName[2] == 'l' || $sFieldName[2] == 'L' || isset($sFieldName[16]) && ($sFieldName[16] == 'l' || $sFieldName[16] == 'L')) { if ('oxlongdesc' === strtolower($sFieldName) || 'oxcategories__oxlongdesc' === strtolower($sFieldName)) { $iDataType = oxField::T_RAW; } } return parent::_setFieldData($sFieldName, $sValue, $iDataType); }
/** * Instantiates oxTagSet object */ public function __construct() { parent::__construct(); $this->_oTagSet = oxNew('oxTagSet'); }
/** * Class constructor, initiates parent constructor (parent::oxI18n()). */ public function __construct() { parent::__construct(); $this->init("oxstates"); }
/** * Class constructor * * @return null */ public function __construct() { parent::__construct(); $this->init('mib_test'); }