Closed saeideng closed 7 years ago
You can create a custom writer class which deletes related files when the primary file is deleted.
callback is just for creating file
constructFiles()
used in beforeSave()
I never said anything about a callback :) I said create a custom Writer class and override it's delete () method.
I never said anything about a callback :)
i know :smiley: but callback is good choice and fast develop
some ting like
delete=>interface ....($name,$patch){//patch file in db
return [
$patch+$name,
$patch+'prefix_'+$name,
$patch+$name+'_tumb_200_200.jpg',
]
}
i looking for custom class like
transformer
I was going by this statement. The writer class is that custom class :)
thanks closing as related PR merged now
we can generate other file (like thumb ) from primary file but when deleting a record we expected all of file (primary +related file) should delete from filesystem but just primary file deleted from filesystem ,and related file file still retain in filesystem there is not a callback for this now i looking for custom class like
transformer
EDIT: a callback for this