User :: convertTo: Bitrix method

      
<?php 
//  Bitrix\Bizproc\BaseType\User :: convertTo()
//  /dist/bitrix/modules/bizproc/lib/basetype/user.php:87

    
public static function convertTo(FieldType $fieldType$value$toTypeClass)
    {
        
/** @var Base $toTypeClass */
        
$type $toTypeClass::getType();
        switch (
$type)
        {
            case 
FieldType::DOUBLE:
            case 
FieldType::INT:
                
$value = (string)$value;
                if (
strpos($value'user_') === 0)
                    
$value substr($valuestrlen('user_'));
                
$value = (int)$value;
                break;
            case 
FieldType::STRING:
            case 
FieldType::TEXT:
            case 
FieldType::USER:
                
$value = (string)$value;
                break;
            default:
                
$value null;
        }

        return 
$value;
    }