Bitrix Site Manager

OnAfterIBlockSectionAdd event

event_handler(
 array &arFields
);
Fired after an attempt to add a new information block section by a call to CIBlockSection::Add.

Parameters

ParameterDescription
arFields An array of the new information block section fields.

The additional entry "RESULT" contains the value returned by the CIBlockSection::Add method. If an error occurred during the method execution, the entry "RESULT_MESSAGE" contains the error description.

Note
The parameter(s) of this handler are references to the original variables. Hence, altering their values from within the handler causes changing values of the source variables passed to the handler.

See Also

  • OnBeforeIBlockSectionAdd event
  • CIBlockSection::Add
  • Handling events

    Example

    
    <?
    // file /bitrix/php_interface/init.php
    // register handler
    AddEventHandler("iblock", 
                    "OnAfterIBlockSectionAdd", 
                    Array("MyClass", "OnAfterIBlockSectionAddHandler"));
    
    class MyClass
    {
        // create handler "OnAfterIBlockSectionAdd"
        function OnAfterIBlockSectionAddHandler(&$arFields)
        {
            if($arFields["RESULT"])
                AddMessage2Log("Redord ID=".
                               $arFields["ID"]." was added.");
            else
                AddMessage2Log("Error adding record ".
                               $arFields["ID"].
                               " (".$arFields["RESULT_MESSAGE"].").");
        }
    }
    ?>