• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/onlyoffice/documentsessionmanager.php
  • Класс: BitrixDiskDocumentOnlyOfficeDocumentSessionManager
  • Вызов: DocumentSessionManager::buildFilter
protected function buildFilter(): array
{
	$filter = [
		'USER_ID' => $this->userId,
		'TYPE' => $this->sessionType,
		'IS_EXCLUSIVE' => false,
		'STATUS' => ModelsDocumentSession::STATUS_ACTIVE,
		'VERSION_ID' => null,
	];

	if ($this->version)
	{
		$filter['VERSION_ID'] = $this->version->getId();
		$filter['OBJECT_ID'] = $this->version->getObjectId();
	}
	elseif ($this->file)
	{
		$filter['OBJECT_ID'] = $this->file->getRealObjectId();
	}
	elseif ($this->attachedObject)
	{
		$filter['OBJECT_ID'] = $this->attachedObject->getObjectId();
		if ($this->attachedObject->isSpecificVersion())
		{
			$filter['VERSION_ID'] = $this->attachedObject->getVersionId();
		}
	}
	else
	{
		throw new ArgumentException('Neither file nor version nor attached object were installed.');
	}

	return $filter;
}