コード例 #1
0
ファイル: product.php プロジェクト: ASDAFF/bxApiDocs
	public static function OnIBlockElementDelete($ProductID)
	{
		global $DB;
		$ProductID = intval($ProductID);

		return CCatalogProduct::Delete($ProductID);
	}
コード例 #2
0
ファイル: product.php プロジェクト: andy-profi/bxApiDocs
 public static function OnIBlockElementDelete($ProductID)
 {
     return CCatalogProduct::Delete($ProductID);
 }
コード例 #3
0
ファイル: catalog.php プロジェクト: DarneoStudio/bitrix
 public function Delete($ID)
 {
     global $DB;
     $ID = (int) $ID;
     foreach (GetModuleEvents("catalog", "OnBeforeCatalogDelete", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             return false;
         }
     }
     foreach (GetModuleEvents("catalog", "OnCatalogDelete", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID));
     }
     $bSuccess = true;
     $dbRes = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $ID));
     while ($arRes = $dbRes->Fetch()) {
         if (!CCatalogProduct::Delete($arRes["ID"])) {
             $bSuccess = false;
         }
     }
     if ($bSuccess) {
         if (isset(self::$arCatalogCache[$ID])) {
             unset(self::$arCatalogCache[$ID]);
             if (defined('CATALOG_GLOBAL_VARS') && CATALOG_GLOBAL_VARS == 'Y') {
                 global $CATALOG_CATALOG_CACHE;
                 $CATALOG_CATALOG_CACHE = self::$arCatalogCache;
             }
         }
         if (isset(self::$catalogVatCache[$ID])) {
             unset(self::$catalogVatCache[$ID]);
         }
         CCatalogSKU::ClearCache();
         CCatalogProduct::ClearCache();
         return $DB->Query("DELETE FROM b_catalog_iblock WHERE IBLOCK_ID = " . $ID, true);
     }
     return false;
 }
コード例 #4
0
ファイル: catalog.php プロジェクト: k-kalashnikov/geekcon_new
 function Delete($ID)
 {
     global $DB;
     $ID = intval($ID);
     $bCanDelete = true;
     $db_events = GetModuleEvents("catalog", "OnBeforeCatalogDelete");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             return false;
         }
     }
     $events = GetModuleEvents("catalog", "OnCatalogDelete");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($ID));
     }
     $bSuccess = true;
     $dbRes = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $ID));
     while ($arRes = $dbRes->Fetch()) {
         if (!CCatalogProduct::Delete($arRes["ID"])) {
             $bSuccess = false;
         }
     }
     unset($GLOBALS["CATALOG_CATALOG_CACHE"][$ID]);
     if ($bSuccess) {
         return $DB->Query("DELETE FROM b_catalog_iblock WHERE IBLOCK_ID = " . $ID . " ", true);
     } else {
         return false;
     }
 }