Documentation

OnBeforeIBlockDelete

bool
user_defined_handler(
 int ID 
);

The event OnBeforeIBlockDelete is called before meeting an information block.

Parameters

ParameterDescription
ID Information block ID

Returned values

The user-defined handler returns false to prevent the information block from deletion.

Example

<?
// Connect the handler
RegisterModuleDependences("iblock", 
                          "OnBeforeIBlockDelete", 
                          "catalog", 
                          "CCatalog", 
                          "OnIBlockDelete");

// Implement the handler
class CCatalog
{
  * * *

  public static function OnBeforeIBlockDelete($ID)
  {
    // Information blocks cannot be deleted.
    return false;
  }
}

?>
© «Bitrix24», 2001-2024
Up