• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documenthandlersmanager.php
  • Класс: BitrixDiskDocumentDocumentHandlersManager
  • Вызов: DocumentHandlersManager::getHandlerByCode
public function getHandlerByCode($code)
{
	if(!isset($this->documentHandlerList[$code]))
	{
		$this->errorCollection->add(array(new Error("Unknown document handler name {$code}", self::ERROR_UNKNOWN_HANDLER)));
		return null;
	}

	/** @var DocumentHandler $documentHandler */
	$documentHandler = new $this->documentHandlerList[$code]($this->userId);
	if(!$documentHandler instanceof DocumentHandler)
	{
		throw new SystemException("Invalid class '{$this->documentHandlerList[$code]}' for documentHandler. Must be instance of DocumentHandler");
	}

	return $documentHandler;
}