CBPRestActivity::ValidateProperties: Bitrix method

      
<?php 
//  CBPRestActivity :: ValidateProperties()
//  /dist/bitrix/modules/bizproc/classes/general/restactivity.php:625

    
public static function ValidateProperties($testProperties = array(), CBPWorkflowTemplateUser $user null)
    {
        
$errors = array();

        
$activityData self::getRestActivityData();

        if (!
$activityData)
        {
            return 
$errors;
        }

        
$properties = isset($activityData['PROPERTIES']) && is_array($activityData['PROPERTIES']) ? $activityData['PROPERTIES'] : array();
        foreach (
$properties as $name => $property)
        {
            
$value = isset($property['DEFAULT']) ? $property['DEFAULT'] : null;
            if (isset(
$testProperties[$name]))
                
$value $testProperties[$name];
            if (
CBPHelper::getBool($property['REQUIRED']) && CBPHelper::isEmptyValue($value))
            {
                
$errors[] = array(
                    
'code' => 'NotExist',
                    
'parameter' => $name,
                    
'message' => Loc::getMessage('BPRA_PD_ERROR_EMPTY_PROPERTY',
                        array(
                            
'#NAME#' => RestActivityTable::getLocalization($property['NAME'], LANGUAGE_ID)
                        )
                    )
                );
            }

        }

        if (
            isset(
$testProperties['AuthUserId'])
            && isset(
$activityData['AUTH_USER_ID'])
            && (string) 
$testProperties['AuthUserId'] !== $activityData['AUTH_USER_ID']
            && !static::
checkAdminPermissions()
        )
        {
            
$errors[] = array(
                
'code' => 'NotExist',
                
'parameter' => 'AuthUserId',
                
'message' => Loc::getMessage('BPRA_PD_ERROR_EMPTY_PROPERTY',
                    array(
                        
'#NAME#' => Loc::getMessage('BPRA_PD_USER_ID')
                    )
                )
            );
        }

        return 
array_merge($errorsparent::ValidateProperties($testProperties$user));
    }