Documentation

OnIBlockElementDelete

handler function(
 int ID 
);

The event OnIBlockElementDelete is called when deleting an iblock element.

Note: starting from version 15.5.12, the event is called before deleting any data from tables associated with the element.

Parameters

ParameterDescription
ID Iblock element ID.

Example


<?
// Connect the handler
RegisterModuleDependences("iblock", 
                          "OnIBlockElementDelete", 
                          "catalog", 
                          "CCatalogProduct", 
                          "OnIBlockElementDelete");

// Implement the handler
class CCatalogProduct
{
  * * *

  public static function OnIBlockElementDelete($PRODUCT_ID)
  {
    // Now the handler is called upon deletion
    global $DB;
    echo "Deleting...";
    return True;
  }
}
?>
© «Bitrix24», 2001-2024
Up