[Solar-talk] Sql_Model insert not working!
Jeff Surgeson
solar at 3hex.com
Tue Apr 24 06:45:21 PDT 2007
On Tuesday 24 April 2007 14:28, Rodrigo Moraes wrote:
> On 4/23/07, Jeff Surgeson wrote:
> > Ok got it to work like this, but it is not very elegant but I can see no
> > other way to merge form and default data!
>
> There's still no integration with the form class, but you can set the
> properties that are not in the form directly in the $item object, and
> in the end pass an array with form data to be saved -
> $item->save($form_data). maybe it'll be a bit cleaner.
>
> In the example, if you get the $form_data values using $form_data =
> $form->values('addform'), you won't need to retrieve them one by one,
> and can pass that array to be saved. I'm not sure if any non-existent
> model property in the array will throw an exception on save(), though,
> but I guess they won't.
Makes sense! cheers :-D
--
...........::::::...........
Jeff Surgeson / South Africa
More information about the solar-talk
mailing list