...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
- Класс: \CCrmProductRestProxy
- Вызов: CCrmProductRestProxy::processEvent
static function processEvent(array $arParams, array $arHandler) { $eventName = $arHandler['EVENT_NAME']; switch(mb_strtolower($eventName)) { case 'oncrmproductadd': case 'oncrmproductupdate': { $ID = isset($arParams[0])? (int)$arParams[0] : 0; if($ID <= 0) { throw new RestException("Could not find entity ID in fields of event \"{$eventName}\""); } $fields = CCrmProduct::GetByID($ID); $catalogID = is_array($fields) && isset($fields['CATALOG_ID'])? (int)$fields['CATALOG_ID'] : 0; if($catalogID !== CCrmCatalog::GetDefaultID()) { throw new RestException("Outside CRM product event is detected"); } return array('FIELDS' => array('ID' => $ID)); } break; case 'oncrmproductdelete': { $fields = isset($arParams[0]) && is_array($arParams[0])? $arParams[0] : array(); $ID = isset($fields['ID'])? (int)$fields['ID'] : 0; if($ID <= 0) { throw new RestException("Could not find entity ID in fields of event \"{$eventName}\""); } $catalogID = isset($fields['IBLOCK_ID'])? (int)$fields['IBLOCK_ID'] : 0; if($catalogID !== CCrmCatalog::GetDefaultID()) { throw new RestException("Outside CRM product event is detected"); } return array('FIELDS' => array('ID' => $ID)); } break; default: throw new RestException("The Event \"{$eventName}\" is not supported in current context"); } }