FileProcessingService
This is a general service for creating Processed Files a.k.a. processing a File object with a given configuration.
This is how it works: -> File->process(string $taskType, array $configuration) -> ResourceStorage->processFile(File $file, $taskType, array $configuration) -> FileProcessingService->processFile(File $file, $taskType, array $configuration)
This class then transforms the information of a Task through a Processor into a ProcessedFile object. For this, the DB is checked if there is a ProcessedFile which has been processed or does not need to be processed. If processing is required, a valid Processor is searched for to process the Task object (which is retrieved from ProcessedFile->getTask()).
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $eventDispatcher : EventDispatcherInterface
- $processedFileRepository : ProcessedFileRepository
- $processorRegistry : ProcessorRegistry
Methods
Properties
$eventDispatcher read-only
protected
EventDispatcherInterface
$eventDispatcher
$processedFileRepository read-only
protected
ProcessedFileRepository
$processedFileRepository
$processorRegistry read-only
protected
ProcessorRegistry
$processorRegistry
Methods
__construct()
public
__construct(EventDispatcherInterface $eventDispatcher, ProcessedFileRepository $processedFileRepository, ProcessorRegistry $processorRegistry) : mixed
Parameters
- $eventDispatcher : EventDispatcherInterface
- $processedFileRepository : ProcessedFileRepository
- $processorRegistry : ProcessorRegistry
processFile()
public
processFile(File|FileReference $fileObject, string $taskType, DriverInterface $driver, array<string|int, mixed> $configuration) : ProcessedFile
Parameters
- $fileObject : File|FileReference
- $taskType : string
- $driver : DriverInterface
- $configuration : array<string|int, mixed>
Return values
ProcessedFilegetProcessorByTask()
protected
getProcessorByTask(TaskInterface $task) : ProcessorInterface
Parameters
- $task : TaskInterface