Documentation

OnBeforeIBlockPropertyUpdate

bool
event_handler(
 array &arParams
);
The event OnBeforeIBlockPropertyUpdate is fired from CIBlockProperty::Update before the information block property become modified. Can be used to cancel modification or to redefine fields.

Parameters

ParameterDescription
arParams An array of the information block property fields.

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.

Returned value

To cancel the update and terminate CIBlockProperty::Update throw an exception by calling ThrowException() within the handler and return false.

See Also

  • OnAfterIBlockPropertyUpdate event
  • CIBlockProperty::Update

    Example

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