• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/onlyoffice/models/documentsessioncontext.php
  • Класс: BitrixDiskDocumentOnlyOfficeModelsDocumentSessionContext
  • Вызов: DocumentSessionContext::buildByAttachedObject
static function buildByAttachedObject(AttachedObject $attachedObject): self
{
	if (!($attachedObject->getFile() instanceof File))
	{
		throw new ArgumentException('Attached object model doesn't have file.');
	}

	$context = new self(
		$attachedObject->getFile()->getRealObjectId(),
		$attachedObject->getId()
	);

	$context
		->setObject($attachedObject->getFile())
		->setAttachedObject($attachedObject)
	;

	return $context;
}