18 protected static function getDiskFiles(
int $sourceId,
string $entityType,
string $module): array
22 if (\
Bitrix\Main\Loader::includeModule(
'disk'))
24 $userId = \Bitrix\Landing\Manager::getUserId();
25 $filePrefix = \Bitrix\Disk\Uf\FileUserType::NEW_FILE_PREFIX;
26 $attachedModels = \Bitrix\Disk\AttachedObject::getModelList([
28 '=ENTITY_ID' => $sourceId,
29 '=ENTITY_TYPE' => $entityType,
30 '=MODULE_ID' => $module
33 foreach ($attachedModels as $attachedModel)
35 if (!$attachedModel->canRead($userId))
40 'id' => $attachedModel->getId(),
41 'object_id' => $attachedModel->getObjectId(),
42 'file_id' => $attachedModel->getFileId(),
43 'file_name' => $attachedModel->getName(),
46 $files[$attachedModel->getId()] = $item;
47 $item[
'prefix'] = $filePrefix;
48 $files[$filePrefix . $attachedModel->getObjectId()] = $item;