Helper :: prepareDiskAttachments: Bitrix method

      
<?php 
//  Bitrix\Bizproc\Automation\Helper :: prepareDiskAttachments()
//  /dist/bitrix/modules/bizproc/lib/automation/helper.php:128

    
public static function prepareDiskAttachments($attachments)
    {
        
$result = array();

        if (!
Loader::includeModule('disk'))
            return 
$result;

        foreach ((array)
$attachments as $attachmentId)
        {
            
$attachmentId = (int)$attachmentId;
            if (
$attachmentId <= 0)
            {
                continue;
            }

            
$file Disk\File::loadById($attachmentId);
            if (
$file)
            {
                
$result[] = array(
                    
'id' => $file->getId(),
                    
'name' => $file->getName(),
                    
'size' => \CFile::FormatSize($file->getSize()),
                    
'type' => 'disk'
                
);
            }
        }

        return 
$result;
    }