117 $folderModel = \CIMDisk::getFolderModel($chatId,
false);
118 if ($folderModel ===
false)
120 return new \Bitrix\Im\V2\Entity\File\FileCollection();
122 $relation = \CIMChat::GetRelationById($chatId, $this->getContext()->getUserId(),
true,
false);
123 $filter = Query::filter()
124 ->where(
'PARENT_ID', $folderModel->getId())
125 ->where(
'STORAGE_ID', $folderModel->getStorageId())
126 ->where(
'ID',
'>', $relation[
'LAST_FILE_ID'])
130 $filter->where(
'ID',
'<', $lastId);
132 if (isset($filename))
134 $clearFileName = str_replace(
"%",
'', $filename);
135 $filter->whereLike(
'NAME',
"$clearFileName%");
139 'with' => [
'CREATE_USER'],
141 'order' => [
'ID' =>
'DESC']
143 $securityContext =
new DiskSecurityContext($this->getContext()->getUserId());
144 $parameters = Driver::getInstance()->getRightsManager()->addRightsCheck($securityContext, $parameters, [
'ID',
'CREATED_BY']);
145 $diskFiles = File::getModelList($parameters);
147 return new \Bitrix\Im\V2\Entity\File\FileCollection($diskFiles, $chatId);