CBPAllHistoryService::RecoverDocumentFromHistory: Bitrix method

      
<?php 
//  CBPAllHistoryService :: RecoverDocumentFromHistory()
//  /dist/bitrix/modules/bizproc/classes/general/historyservice.php:193

    
public static function RecoverDocumentFromHistory($id)
    {
        
$arHistory self::GetById($id);
        if (!
$arHistory)
            throw new 
Exception(str_replace("#ID#"intval($id), GetMessage("BPCGHIST_INVALID_ID")));

        list(
$moduleId$entity$documentId) = CBPHelper::ParseDocumentId($arHistory["DOCUMENT_ID"]);

        if (
strlen($moduleId) > 0)
            
CModule::IncludeModule($moduleId);

        if (
class_exists($entity))
            return 
call_user_func_array(array($entity"RecoverDocumentFromHistory"), array($documentId$arHistory["DOCUMENT"]));

        return 
false;
    }