• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documentcontroller.php
  • Класс: BitrixDiskDocumentDocumentController
  • Вызов: DocumentController::addFileEditSessionByCurrentUser
protected function addFileEditSessionByCurrentUser(FileData $fileData)
{
	$data = array(
		'OBJECT_ID' => $this->file->getRealObjectId(),
		'USER_ID' => $this->getUser()->getId(),
		'OWNER_ID' => $this->getUser()->getId(),
		'SERVICE' => $this->documentHandler::getCode(),
		'SERVICE_FILE_ID' => $fileData->getId(),
		'SERVICE_FILE_LINK' => $fileData->getLinkInService(),
	);
	if($this->isSpecificVersion())
	{
		$data['VERSION_ID'] = $this->version->getId();
		$data['IS_EXCLUSIVE'] = 1;
	}

	if (Configuration::isEnabledObjectLock() && Configuration::shouldAutoLockObjectOnEdit())
	{
		if ($this->checkLockPermissions() && !$this->file->getLock())
		{
			$this->file->lock($this->getUser()->getId());
		}
	}

	return EditSession::add($data, $this->errorCollection);
}