CBPHelper::ExtractUsersFromUserGroups: Bitrix method

      
<?php 
//  CBPHelper :: ExtractUsersFromUserGroups()
//  /dist/bitrix/modules/bizproc/classes/general/helper.php:1838

    
public static function ExtractUsersFromUserGroups($value$activity)
    {
        
$result = [];

        if (!
is_array($value))
        {
            
$value = array($value);
        }

        
$l strlen("user_");
        
$runtime CBPRuntime::GetRuntime();
        
$documentService $runtime->GetService("DocumentService");

        foreach (
$value as $v)
        {
            if (
substr($v0$l) == "user_")
            {
                
$result[] = $v;
            }
            else
            {
                
$arDSUsers self::extractUsersFromExtendedGroup($v);
                if (
$arDSUsers === false)
                {
                    
$arDSUsers $documentService->GetUsersFromUserGroup($v$activity->GetDocumentId());
                }
                foreach (
$arDSUsers as $v1)
                {
                    
$result[] = "user_".$v1;
                }
            }
        }

        return 
$result;
    }