Base::renderControlMultiple: Bitrix method

      
<?php 
//  Bitrix\Bizproc\BaseType\Base :: renderControlMultiple()
//  /dist/bitrix/modules/bizproc/lib/basetype/base.php:440

    
public static function renderControlMultiple(FieldType $fieldType, array $field$value$allowSelection$renderMode)
    {
        
$selectorValue null;
        
$typeValue = array();
        if (!
is_array($value) || is_array($value) && \CBPHelper::isAssociativeArray($value))
            
$value = array($value);

        foreach (
$value as $v)
        {
            if (\
CBPActivity::isExpression($v))
                
$selectorValue $v;
            else
                
$typeValue[] = $v;
        }
        
// need to show at least one control
        
if (empty($typeValue))
            
$typeValue[] = null;

        
$controls = [];

        foreach (
$typeValue as $k => $v)
        {
            
$singleField $field;
            
$singleField['Index'] = $k;
            
$controls[] = static::renderControl(
                
$fieldType,
                
$singleField,
                
$v,
                
$allowSelection,
                
$renderMode
            
);
        }

        if (
$renderMode FieldType::RENDER_MODE_PUBLIC)
        {
            
$renderResult = static::renderPublicMultipleWrapper($fieldType$field$controls);
        }
        else
        {
            
$renderResult = static::wrapCloneableControls($controls, static::generateControlName($field));
        }

        if (
$allowSelection)
        {
            
$renderResult .= static::renderControlSelector($field$selectorValuetrue''$fieldType);
        }

        return 
$renderResult;
    }