I have set up the VichUploaderBundle to facilitate the upload of a profile image for my User entity. I am using the GaufretteStorage option, configured to use the local filesystem and all is working fine when users upload an image via a form.
I now want to be able to assign a profile image file to a User entity in the code myself rather than relying on users to upload through the form. How do I do this?
I hope I am being clear enough.... essentially I have the contents of an image file (that I can grab through file_get_contents() or a similar measure) and I would like to assign this file to the User profile image attribute.