RestService :: validateActivityProperties: Bitrix method

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

    
private static function validateActivityProperties($properties$isRobot false)
    {
        if (!
is_array($properties))
            throw new 
RestException('Wrong properties array!'self::ERROR_ACTIVITY_VALIDATION_FAILURE);

        
$map =     array(
            
FieldType::BOOL => true,
            
FieldType::DATE => true,
            
FieldType::DATETIME => true,
            
FieldType::DOUBLE => true,
            
FieldType::INT => true,
            
FieldType::SELECT => true,
            
FieldType::STRING => true,
            
FieldType::TEXT => true,
            
FieldType::USER => true,
        );

        foreach (
$properties as $key => $property)
        {
            if (!
preg_match('#^[a-z][a-z0-9_]*$#i'$key))
                throw new 
RestException('Wrong property key ('.$key.')!'self::ERROR_ACTIVITY_VALIDATION_FAILURE);
            if (empty(
$property['NAME']))
                throw new 
RestException('Empty property NAME ('.$key.')!'self::ERROR_ACTIVITY_VALIDATION_FAILURE);

            if (
$isRobot)
            {
                
$type = isset($property['TYPE']) ? $property['TYPE'] : FieldType::STRING;
                if (!
array_key_exists($type$map))
                    throw new 
RestException('Unsupported property type ('.$type.')!'self::ERROR_ACTIVITY_VALIDATION_FAILURE);
            }
        }
    }