Let me make a better reply. On Fri, Nov 7, 2008 at 2:42 PM, juro <[EMAIL PROTECTED]> wrote:
> > Hi, > I am trying (desperately) to create a custom widget/validator that > modifies the n:m relationship with a quantity field. > > For this, I need to understand the form system: > > 1. When editing an existing entry, when and how are the widgets > populated with values from the database? I do think the $value > parameter holds the values but where are they set? > The values are populated when you instantiate the form initially like so: $form = new sfForm($initialValues); and when you do: $form->bind($tainedValues); > > 2. When is the entry of a widget saved? I know that $form->save() > calls the save method - but somewhere, the form has to know how to > save the values. E.g. when using a DoctrineChoiceMany widget, where is > the code that actually creates, modifies or deletes entries in the > through class? > Check out the generated form classes. You will see methods like updateDefaultsFromObject(), saveRelationNameList(), etc. All other values are updated to the object in the sfFormDoctrine::updateObject() method where we simply use the Doctrine_Record::fromArray() method. > I hope these questions are clear enough. > > juro > > > > -- Jonathan H. Wage Open Source Software Developer & Evangelist http://www.jwage.com http://www.doctrine-project.org http://www.symfony-project.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
