- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/compatible/eventcompatibility.php
- Класс: BitrixSaleCompatibleEventCompatibility
- Вызов: EventCompatibility::onOrderDelete
static function onOrderDelete(MainEvent $event)
{
if (static::$disableEvent === true)
{
return new MainEventResult( MainEventResult::SUCCESS, null, 'sale');
}
$parameters = $event->getParameters();
/** @var SaleOrder $order */
$order = $parameters['ENTITY'];
if (!$order instanceof SaleOrder)
{
return new MainEventResult(
MainEventResult::ERROR,
new SaleResultError(MainLocalizationLoc::getMessage('SALE_EVENT_COMPATIBILITY_WRONG_ORDER'), 'SALE_EVENT_COMPATIBILITY_ORDER_DELETE_WRONG_ORDER'),
'sale'
);
}
$deleted = $parameters['VALUE'];
$id = $order->getId();
static::setDisableEvent(true);
foreach(GetModuleEvents("sale", static::EVENT_COMPATIBILITY_ON_ORDER_DELETED, true) as $oldEvent)
{
ExecuteModuleEventEx($oldEvent, array($id, $deleted));
}
static::setDisableEvent(false);
return new MainEventResult( MainEventResult::SUCCESS, null, 'sale');
}