FieldType::normalizeProperty: Bitrix method

      
<?php 
//  Bitrix\Bizproc\FieldType :: normalizeProperty()
//  /dist/bitrix/modules/bizproc/lib/fieldtype.php:471

    
public static function normalizeProperty($property)
    {
        
$normalized = [
            
'Type' => null,

            
'Name' => null,
            
'Description' => null,

            
'Multiple' => false,
            
'Required' => false,

            
'Options' => null,
            
'Settings' => null,
            
'Default' => null,
        ];

        if (
is_array($property))
        {
            foreach (
$property as $key => $val)
            {
                switch (
strtoupper($key))
                {
                    case 
'TYPE':
                    case 
'0':
                        
$normalized['Type'] = (string) $val;
                        break;
                    case 
'MULTIPLE':
                    case 
'1':
                        
$normalized['Multiple'] = \CBPHelper::getBool($val);
                        break;
                    case 
'REQUIRED':
                    case 
'2':
                        
$normalized['Required'] = \CBPHelper::getBool($val);
                        break;
                    case 
'OPTIONS':
                    case 
'3':
                        
$normalized['Options'] = is_array($val) ? $val : (string)$val;
                        break;
                    case 
'SETTINGS':
                        {
                            if(
is_array($val))
                            {
                                
$normalized['Settings'] = $val;
                            }
                        }
                        break;
                    case 
'NAME':
                        {
                            
$normalized['Name'] = (string) $val;
                        }
                        break;
                    case 
'DESCRIPTION':
                        {
                            
$normalized['Description'] = (string) $val;
                        }
                        break;
                    case 
'DEFAULT':
                        {
                            
$normalized['Default'] = $val;
                        }
                        break;
                }
            }
        }
        else
        {
            
$normalized['Type'] = (string) $property;
        }

        return 
$normalized;
    }