I am working on a database model that will hold meta data about a file and the location of a file on s3. I would like to set up this model to use the aws bundle https://github.com/Cybernox/AmazonWebServicesBundle/ so that when a user uploads a file and some meta data I can take the file move it to s3 and store the file location in the database. It seems it would be the driest implementation to move the file to s3 in the model and save the new url there, this way the method can be used by multiple controllers. But I cannot figure out how to gain access to this service inside the model since the service container is not available. Any advice? I could inject the service from the controller but this seems like it would get redundant.
Thanks,
CG
The model should not know anything about the environment using it. If you want to set something in model, do it in a controller, service or Doctrine listener.