Open michalcharvat opened 1 week ago
1) Nope you cant if you dont create standard export because you cant avoid use exportEntity method. I have to prepare data for this custom export before I process them and processing is a bit complex. Basically I skip exportEntity method. Currently I have to copy paste everything from the AbstractConverter and Spreadsheet just to use similar logic - it works well for HTML and XLSX (I didnt tested it with CSV). Sure it is probably much safer because class depends on core but if you add there conditiions to check if converter uses AbstractConverter I am in trouble. 2) My bad you can really have it in Spreadsheet class. You need call that method during the processing data, in other case only latest sheet will be colorised
1) AbstractConverter:
public final function exportToBlob(Query $entities, array $params = []): Blob
change topublic function exportToBlob(Query $entities, array $params = []): Blob
Reason is simple - if you have to use existing functionality except simple logic from exportToBlob method you have to copy paste almost whole logic from Spreadsheet / AbstractConverter. Another option could be new method called processExport which will be public but not final so method exportToBlob will stay as is 2) Spreadsheet: finishExport - I would like to split logic from this method to new method called colorizeHeaders. New method will be called in exportToBlob before finishExport and it gives you more flexibility such as create multisheet exports.There will be new dummy colorizeHeaders method in AbstractConverter. FinishExport will just write export to file
If you agree I will prepare PR