Documentation

Delete

bool
  CIBlock::Delete(
 int ID
);

This method deletes an iblock. Static method.

Parameters

ParameterDescription
ID Iblock code.

Returned value

Returns true on success and false otherwise. Deleting can be cancelled in the event handler OnBeforeIBlockDelete.

Example

<?
if($USER->IsAdmin())
{
$DB->StartTransaction();
if(!CIBlock::Delete($iblock_id))
{
$strWarning .= GetMessage("IBLOCK_DELETE_ERROR");
$DB->Rollback();
}
else
$DB->Commit();
}
?>


© «Bitrix24», 2001-2024