• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/file.php
  • Класс: BitrixDiskFile
  • Вызов: File::unlock
public function unlock($unlockedBy, $token = null)
{
	$objectLock = $this->getLock();
	if (!$objectLock)
	{
		return true;
	}

	if (!$objectLock->canUnlock($unlockedBy))
	{
		$this->errorCollection[] = $this->generateUnlockErrorByAnotherUser($objectLock);

		return false;
	}

	if ($token !== null && $objectLock->getToken() !== $token)
	{
		$this->errorCollection[] = new Error(
			Loc::getMessage('DISK_FILE_MODEL_ERROR_INVALID_LOCK_TOKEN'),
			self::ERROR_INVALID_LOCK_TOKEN
		);

		return false;
	}

	$success = $objectLock->delete($unlockedBy);
	if ($success)
	{
		$this->update(array('SYNC_UPDATE_TIME' => new DateTime()));
		Driver::getInstance()->sendChangeStatusToSubscribers($this, 'quick');
	}

	return $success;
}