- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/main/file.php
- Класс: BitrixSocialnetworkIntegrationMainFile
- Вызов: File::getFilesSources
static function getFilesSources(
array $fileIds,
int $width = 50,
int $height = 50,
bool $immediate = false
): array
{
if (empty($fileIds))
{
return [];
}
$filesSources = array_fill_keys($fileIds, '');
$res = CFile::GetList([], ['@ID' => implode(',', $fileIds)]);
while ($file = $res->Fetch())
{
$fileInfo = CFile::ResizeImageGet(
$file,
[
'width' => $width,
'height' => $height,
],
BX_RESIZE_IMAGE_EXACT,
false,
false,
$immediate
);
$filesSources[$file['ID']] = $fileInfo['src'];
}
return $filesSources;
}