|sfWidgetFormDoctrineChoice return value [message #103094]
||Mon, 26 July 2010 16:22
Registered: June 2010
I'm using Symfony 1.4 with Doctrine.
In a generated doctrine module, I want to capture multiple choices (for image ids), which I'm prepared to store in a string type mysql field.
So for the attached field in Symfony, I have the following widget:
sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('whatever'), 'add_empty' => true, 'multiple' => true))
It looks exactly as I want, but unfortunately, it returns a value of "Array" back to the DB. I've tried searching for the insert point where I could look for and breakdown this array in setImages (the name of the field) in the base model, but I was unsuccessful.
The larger picture btw, is that I have these "posts" to which I need to attach multiple images, which are a different model on their own.
I tried to do this initially using Doctrine's foreign keys, but this way, I could only attach posts to images, rather than images to posts. I couldn't figure out a way around that, so if someone has had similar experiences and has a solution, I would appreciate that as well.