Пример #1
0
 /**
  * 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);
 }
Пример #2
0
 /**
  * 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);
 }
Пример #3
0
 /**
  * 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);
 }
Пример #4
0
 /**
  * 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;
 }
Пример #5
0
 /**
  * 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);
 }
Пример #6
0
 /**
  * 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;
 }
Пример #7
0
 /**
  * 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);
 }
Пример #8
0
 /**
  * Deletes object information from DB, 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;
     }
     if ($blDelete = parent::delete($sOxid)) {
         $oDb = oxDb::getDb();
         $oDb->execute("delete from oxobject2group where oxobject2group.oxobjectid = " . $oDb->quote($sOxid));
     }
     return $blDelete;
 }
Пример #9
0
 /**
  * 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;
 }
Пример #10
0
 /**
  * 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;
 }
Пример #11
0
 /**
  * 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);
 }
Пример #12
0
 /**
  * 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;
 }
Пример #13
0
 /**
  * Deletes record and other information related to this article such as images from DB,
  * also removes variants. Returns true on success.
  *
  * @param string $sOXID Article id
  *
  * @return bool
  */
 public function delete($sOXID = null)
 {
     if (!$sOXID) {
         $sOXID = $this->getId();
     }
     if (!$sOXID) {
         return false;
     }
     // #2339 delete first variants before deleting parent product
     $this->_deleteVariantRecords($sOXID);
     $this->load($sOXID);
     $this->_deletePics();
     $this->_onChangeResetCounts($sOXID, $this->oxarticles__oxvendorid->value, $this->oxarticles__oxmanufacturerid->value);
     // delete self
     parent::delete($sOXID);
     $rs = $this->_deleteRecords($sOXID);
     oxRegistry::get("oxSeoEncoderArticle")->onDeleteArticle($this);
     $this->onChange(ACTION_DELETE, $sOXID, $this->oxarticles__oxparentid->value);
     return $rs->EOF;
 }
Пример #14
0
 /**
  * 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 (parent::delete($sOXID)) {
         oxRegistry::get("oxSeoEncoderContent")->onDeleteContent($sOXID);
         return true;
     }
     return false;
 }
Пример #15
0
 /**
  * Deletes record and other information related to this article such as images from DB,
  * also removes variants. Returns true if entry was deleted.
  *
  * @param string $sOXID Article id
  *
  * @throws \Exception
  *
  * @return bool
  */
 public function delete($sOXID = null)
 {
     if (!$sOXID) {
         $sOXID = $this->getId();
     }
     if (!$sOXID) {
         return false;
     }
     $database = oxDb::getDb();
     $database->startTransaction();
     try {
         // #2339 delete first variants before deleting parent product
         $this->_deleteVariantRecords($sOXID);
         $this->load($sOXID);
         $this->_deletePics();
         $this->_onChangeResetCounts($sOXID, $this->oxarticles__oxvendorid->value, $this->oxarticles__oxmanufacturerid->value);
         // delete self
         $deleted = parent::delete($sOXID);
         $this->_deleteRecords($sOXID);
         Registry::get("oxSeoEncoderArticle")->onDeleteArticle($this);
         $this->onChange(ACTION_DELETE, $sOXID, $this->oxarticles__oxparentid->value);
         $database->commitTransaction();
     } catch (Exception $exception) {
         $database->rollbackTransaction();
         throw $exception;
     }
     return $deleted;
 }
Пример #16
0
 /**
  * Delete empty categories, returns true on success.
  *
  * @param string $sOXID Object ID
  *
  * @return bool
  */
 public function delete($sOXID = null)
 {
     if (!$this->getId()) {
         $this->load($sOXID);
     }
     $sOXID = isset($sOXID) ? $sOXID : $this->getId();
     $myConfig = $this->getConfig();
     $oDb = oxDb::getDb();
     $blRet = false;
     if ($this->oxcategories__oxright->value == $this->oxcategories__oxleft->value + 1) {
         $myUtilsPic = oxRegistry::get("oxUtilsPic");
         $sDir = $myConfig->getPictureDir(false);
         // only delete empty categories
         // #1173M - not all pic are deleted, after article is removed
         $myUtilsPic->safePictureDelete($this->oxcategories__oxthumb->value, $sDir . oxRegistry::get("oxUtilsFile")->getImageDirByType('TC'), 'oxcategories', 'oxthumb');
         $myUtilsPic->safePictureDelete($this->oxcategories__oxicon->value, $sDir . oxRegistry::get("oxUtilsFile")->getImageDirByType('CICO'), 'oxcategories', 'oxicon');
         $myUtilsPic->safePictureDelete($this->oxcategories__oxpromoicon->value, $sDir . oxRegistry::get("oxUtilsFile")->getImageDirByType('PICO'), 'oxcategories', 'oxpromoicon');
         $sAdd = " and oxshopid = '" . $this->getShopId() . "' ";
         $oDb->execute("UPDATE oxcategories SET OXLEFT = OXLEFT - 2\n                                           WHERE  OXROOTID = " . $oDb->quote($this->oxcategories__oxrootid->value) . "\n                            AND OXLEFT >   " . (int) $this->oxcategories__oxleft->value . $sAdd);
         $oDb->execute("UPDATE oxcategories SET OXRIGHT = OXRIGHT - 2\n                                           WHERE  OXROOTID = " . $oDb->quote($this->oxcategories__oxrootid->value) . "\n                            AND OXRIGHT >   " . (int) $this->oxcategories__oxright->value . $sAdd);
         // delete entry
         $blRet = parent::delete($sOXID);
         $sOxidQuoted = $oDb->quote($sOXID);
         // delete links to articles
         $oDb->execute("delete from oxobject2category where oxobject2category.oxcatnid={$sOxidQuoted} ");
         // #657 ADDITIONAL delete links to attributes
         $oDb->execute("delete from oxcategory2attribute where oxcategory2attribute.oxobjectid={$sOxidQuoted} ");
         // A. removing assigned:
         // - deliveries
         $oDb->execute("delete from oxobject2delivery where oxobject2delivery.oxobjectid={$sOxidQuoted} ");
         // - discounts
         $oDb->execute("delete from oxobject2discount where oxobject2discount.oxobjectid={$sOxidQuoted} ");
         oxRegistry::get("oxSeoEncoderCategory")->onDeleteCategory($this);
     }
     return $blRet;
 }
Пример #17
0
 /**
  * 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);
 }