ExternalMediaTypes
final readonly class \
Describes the file types which can be indexed, based on the registered text extractors: the extensions, the item type they are stored as, and the label and icon which are shown in the frontend plugin and the backend module.
Internal
Table of Contents
Methods
- __construct() : mixed
- getIcon() : string
- getItemType() : string
- The value stored in the "item_type" field of the index, which unifies different file extensions of the same kind of document.
- getLabel() : string
- Label of the file extension in the media type selector, an empty string if there is none.
- getSupportedExtensions() : array<int, string>
- File extensions for which text extractors exist, without the ones excluded from indexing in the extension configuration.
- isMultiPageItemType() : bool
- Whether documents of an item type are indexed in several parts, which are the page ranges of a PDF file.
Methods
__construct()
public
__construct(TextExtractorRegistry $textExtractorRegistry, ExternalToolConfiguration $externalToolConfiguration) : mixed
Parameters
- $textExtractorRegistry : TextExtractorRegistry
- $externalToolConfiguration : ExternalToolConfiguration
getIcon()
public
getIcon(string $extension) : string
Parameters
- $extension : string
Return values
stringgetItemType()
The value stored in the "item_type" field of the index, which unifies different file extensions of the same kind of document.
public
getItemType(string $extension) : string
Parameters
- $extension : string
Return values
stringgetLabel()
Label of the file extension in the media type selector, an empty string if there is none.
public
getLabel(string $extension, TranslatorInterface $translator) : string
Parameters
- $extension : string
- $translator : TranslatorInterface
Return values
stringgetSupportedExtensions()
File extensions for which text extractors exist, without the ones excluded from indexing in the extension configuration.
public
getSupportedExtensions() : array<int, string>
Return values
array<int, string>isMultiPageItemType()
Whether documents of an item type are indexed in several parts, which are the page ranges of a PDF file.
public
isMultiPageItemType(string $itemType) : bool
Parameters
- $itemType : string