Documentation

OnLanguageDelete

handler function(
 int language_id
);
The event OnLanguageDelete is called when language is deleted. Usually, the purpose of this event handler is to clean the database from the records, associated with the deleted language.

Parameters

ParameterDescription
language_id Deleted language ID.

See Also

Example of handler function:

<?
// file /bitrix/modules/my_module_id/include.php
class MyClass
{
    // create the event handler "OnLanguageDelete"
    function OnLanguageDeleteHandler($language_id)
    {
        // delete the associated records  
        $strSql = "DELETE FROM my_table WH ERE LANGUAGE_ID=".$DB->ForSql($language_id);
        $rs = $DB->Query($strSql, false, "FILE: ".__FILE__."<br>LINE: ".__LINE__);
    }
}
?>

Example of handler function registration:

<?
// register the event handler "OnLanguageDelete"
RegisterModuleDependences("main", "OnLanguageDelete", 
            "my_module_id", "MyClass", "OnLanguageDeleteHandler");
?>


© «Bitrix24», 2001-2022
Up