RestService :: validateDocumentId: Bitrix method

      
<?php 
//  Bitrix\Bizproc\RestService :: validateDocumentId()
//  /dist/bitrix/modules/bizproc/lib/restservice.php:1556

    
private static function validateDocumentId($documentId)
    {
        
$type null;
        if (
$documentId && is_array($documentId))
        {
            try
            {
                
$runtime = \CBPRuntime::getRuntime();
                
$runtime->startRuntime();
                
/** @var \CBPDocumentService $documentService */
                
$documentService $runtime->getService('DocumentService');
                
$documentId $documentService->normalizeDocumentId($documentId);
                
$type $documentService->getDocumentType($documentId);
            }
            catch (\
CBPArgumentNullException $e) {}
        }

        if (!
$type)
        {
            throw new 
RestException('Wrong DOCUMENT_ID!');
        }

        return 
$documentId;
    }