public static function getDocumentTypeName($documentType) { $storageId = self::getStorageIdByType($documentType); if ($storageId) { $storage = Storage::getById($storageId); return '[' . $storage->getSiteId() . '] ' . $storage->getName(); } return $documentType; }
/** * @param $id * @return Disk\Storage * @throws RestException */ private function getStorageById($id) { $storage = Disk\Storage::getById($id); if (!$storage) { throw new RestException("Could not find entity with id '{$id}'.", RestException::ERROR_NOT_FOUND); } return $storage; }