• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documenthandlersmanager.php
  • Класс: BitrixDiskDocumentDocumentHandlersManager
  • Вызов: DocumentHandlersManager::getDefaultServiceForCurrentUser
public function getDefaultServiceForCurrentUser()
{
	//todo may be we should use userId but now we look on $USER;
	static $currentHandler;
	if($currentHandler)
	{
		return $currentHandler;
	}
	$codeForUser = UserConfiguration::getDocumentServiceCode();
	if(empty($codeForUser))
	{
		//todo by default we use googleHandler. But possible create option with default service.
		/** @var GoogleHandler $googleDriveClass */
		$googleDriveClass = GoogleHandler::className();
		$codeForUser = $googleDriveClass::getCode();
	}
	$currentHandler = $this->getHandlerByCode($codeForUser);

	return $currentHandler;
}