DelayInterval :: createFromActivityProperties: Bitrix method

      
<?php 
//  Bitrix\Bizproc\Automation\Engine\DelayInterval :: createFromActivityProperties()
//  /dist/bitrix/modules/bizproc/lib/automation/engine/delayinterval.php:57

    
public static function createFromActivityProperties(array $properties)
    {
        
$params = [];
        if (
is_array($properties))
        {
            if (isset(
$properties['TimeoutTime']))
            {
                
$params Helper::parseDateTimeInterval($properties['TimeoutTime']);
            }
            elseif
            (
                isset(
$properties['TimeoutDuration'])
                && isset(
$properties['TimeoutDurationType'])
                && 
is_numeric($properties['TimeoutDuration'])
                && 
$properties['TimeoutDurationType'] !== 's'
            
)
            {
                if (
$properties['TimeoutDurationType'] === 'm')
                {
                    
$properties['TimeoutDurationType'] = 'i';
                }
                
$params = array(
                    
'type' => static::TYPE_AFTER,
                    
'value' => (int)$properties['TimeoutDuration'],
                    
'valueType' => $properties['TimeoutDurationType'],
                );
            }

            if (isset(
$properties['TimeoutTimeIsLocal']))
            {
                
$params['localTime'] = ($properties['TimeoutTimeIsLocal'] === 'Y');
            }
        }

        return new static(
$params);
    }