[Solar-talk] Sql_Model insert not working!

Rodrigo Moraes rodrigo.moraes at gmail.com
Mon Apr 23 11:19:39 PDT 2007


On 4/23/07, Jeff Surgeson wrote:
>             $item = $form->values();

I'm a bit lost with this part. $form->values() doesn't return a model
object, does it? because later you'll call save() on it, so... I think
this would be more close to what you want:

       if ($this->_isProcess('save') && $form->validate()) {
           $data = $form->values();

           $item->editor_handle = Solar::registry('user')->auth->handle;
           $item->editor_ipaddr = $this->_request->server('REMOTE_ADDR');

           try {
               $item->save($data);
           } catch (Solar_Exception $e) { ..... }
       }

rodrigo


More information about the solar-talk mailing list