Documentation

OnBeforeIBlockSectionUpdate

bool
event_handler(
 array &arParams 
);
The event OnBeforeIBlockSectionUpdate is fired from the method CIBlockSection::Update before an information block section is modified. Can be used to decline modifying a section or to redefine fields.

Parameters

ParameterDescription
arParams An array of fields of the information block section to be updated.

Note
The parameter of this handler is a reference to the original variable. Hence, altering the value(s) from within the handler causes changing values of the source variable passed to the handler.

Returned value

To cancel the information block section update and terminate the method CIBlockSection::Update, throw an exception by calling ThrowException() and return false.

See Also

  • OnAfterIBlockSectionUpdate event
  • CIBlockSection::Update

    Example

     
    <?
    // file /bitrix/php_interface/init.php
    // register handler
    AddEventHandler("iblock", "OnBeforeIBlockSectionUpdate", Array("MyClass", "OnBeforeIBlockSectionUpdateHandler"));
    
    class MyClass
    {
        // create handler "OnBeforeIBlockSectionUpdate"
        function OnBeforeIBlockSectionUpdateHandler(&$arFields)
        {
            if(strlen($arFields["CODE"])<=0)
            {
                global $APPLICATION;
                $APPLICATION->throwException("Enter the mnemonic code. (ID:".$arFields["ID"].")");
                return false;
            }
        }
    }
    ?>
    © «Bitrix24», 2001-2022
    Up