dustin10/VichUploaderBundle — pull request #178 by ShiraNai7 (2013-12-19 13:12:58+00:00)
Title: Implemented fileRemoveProperty to allow removing existing uploads

There is currently no simple way to remove an existing file managed by this bundle. The only options are: replace it with another one or implement the logic yourself. Which, of course, is bad, since "I dont have to implement it myself" is the reason people are using this bundle in the first place.

See issues: #141 #115

I have implemented an additional property called `fileRemoveProperty` that can be configured for each file instance (annotation/yaml). If configured, this property can then be used to mark the file for deletion by setting its value to `true`. Nothing more needs to be done.

This additional functionality should not affect existing setups in any way.

**Conditions for the removal to trigger:**

1. the `fileRemoveProperty` is configured AND its value is `true`
2. the value of `fileNameProperty` is not empty
3. no new file has been just uploaded