I'm using the OneUp Uploader Bundle, with the orphanage, and I'm unsure about how to handle cleaning up entities (that were created by the listener), after the file has been cleaned up by the 'clear-orphans' command - how is this commonly handled?
I'd love to see an event fired for each file that is cleaned up (passing the filename and the mapping) but haven't found anything (assuming the event dispatcher is available to a command).
The idea of the orphanage in the OneupUploaderBundle is that you don't pollute your upload folder with files that don't belong to any entities. This implies that if you use the uploaded files in your entities you should move them out of the orphanage. If you configured a mapping to use the orphanage, all the uploaded files will be stored in a separate folder after uploading.
Citing the documentation:
This means that you can move the logic out of the event listener (which will be called non the less), but move it to the controller where you want to finally upload and store the files in the orphanage.
Be sure to only use the orphanage if you really have to. It has some drawbacks.