CBPHistoryService::AddHistory: Bitrix method

      
<?php 
//  CBPHistoryService :: AddHistory()
//  /dist/bitrix/modules/bizproc/classes/mysql/historyservice.php:12

    
public function AddHistory($arFields)
    {
        global 
$DB;

        
self::ParseFields($arFields0);

        
$arInsert $DB->PrepareInsert("b_bp_history"$arFields);

        
$strSql =
            
"INSERT INTO b_bp_history (".$arInsert[0].", MODIFIED) ".
            
"VALUES(".$arInsert[1].", ".$DB->CurrentTimeFunction().")";
        
$DB->Query($strSqlFalse"File: ".__FILE__."<br>Line: ".__LINE__);

        
$ID intval($DB->LastID());

        
$arEventParams = array(
            
"ID" => $ID,
            
"DOCUMENT_ID" => array($arFields['MODULE_ID'], $arFields['ENTITY'], $arFields['DOCUMENT_ID']),
        );
        foreach (
GetModuleEvents('bizproc''OnAddToHistory'true) as $arEvent)
            
$result ExecuteModuleEventEx($arEvent, array($arEventParams));

        return 
$ID;
    }