- Модуль: disk
- Путь к файлу: ~/bitrix/modules/disk/lib/controller/integration/messengercall.php
- Класс: BitrixDiskControllerIntegrationMessengerCall
- Вызов: MessengerCall::listResumesInChatAction
public function listResumesInChatAction(int $chatId): array
{
$userFieldManager = Driver::getInstance()->getUserFieldManager();
[$className, $moduleId] = $userFieldManager->getConnectorDataByEntityType('im_call');
$filter = [
'=OBJECT.DELETED_TYPE' => ObjectTable::DELETED_TYPE_NONE,
'=OBJECT.CODE' => DocumentOnlyOfficeTemplatesCreateDocumentByCallTemplateScenario::CODE_RESUME,
'=ENTITY_TYPE' => $className,
'=MODULE_ID' => $moduleId,
'=CALL.CHAT_ID' => $chatId,
];
$attachedObjects = AttachedObject::getModelList(
[
'filter' => $filter,
'runtime' => [
new Reference('CALL',
BitrixImModelCallTable::class,
Join::on('this.ENTITY_ID', 'ref.ID'),
),
],
'with' => [
'OBJECT',
],
'limit' => 5,
'order' => [
'ID' => 'DESC',
],
]
);
$resumes = [];
$culture = Context::getCurrent()->getCulture();
$currentUserId = $this->getCurrentUser()->getId();
foreach ($attachedObjects as $attachedObject)
{
if ($attachedObject->canRead($currentUserId))
{
$resumes[] = [
'id' => $attachedObject->getId(),
'object' => [
'id' => $attachedObject->getObjectId(),
'name' => $attachedObject->getName(),
'createDate' => $attachedObject->getCreateTime()->toUserTime()->format($culture->getShortDateFormat()),
],
'links' => [
'edit' => $this->getUrlToEditAttachedObject($attachedObject),
'view' => $this->getUrlToViewAttachedObject($attachedObject),
],
];
}
}
return [
'resumes' => $resumes,
];
}