Bitrix Site Manager

OnLanguageDelete

event_handler(
 int language_id
);

The OnLanguageDelete event fires when a language is deleted. A common task of this handler is to clean the database of records related to the deleted language.

Parameters

ParameterDescription
language_id The ID of the language which is to be deleted.

See Also

Example



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

Example of handler registration


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