[Solar-talk] Sql_Model insert not working!

Rodrigo Moraes rodrigo.moraes at gmail.com
Tue Apr 24 05:28:06 PDT 2007


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.

rodrigo


More information about the solar-talk mailing list