[Solar-talk] Sql_Model insert not working!

Jeff Surgeson solar at 3hex.com
Mon Apr 23 11:10:14 PDT 2007


> No problem. I'll try again. In Solar_Sql_Model::_insert(), we
> previously commented out a piece of code that merged the result of
> fetchNew() to the inserted data. Actually, to get thapiece of code
> working, we need to:

Thanks I got that right, toArray() in my model class modified 
Solar_Sql_Model::insert() as you specified but blow me down I still cant get 
it to insert, this is what I am doing, my actionAdd() function looks like 
this, all comments etc deleted.

public function actionAdd()
{
	$item = $this->_news->fetchNew();
        $form = $this->_news->addForm($item);
        $form->populate();

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

            $item->editor_handle = Solar::registry('user')->auth->handle;
            $item->editor_ipaddr = $this->_request->server('REMOTE_ADDR');
 
            try {
                $item->save();
            } catch (Solar_Exception $e) { ..... }
        }
        $this->formdata = $form;
}

-- 
...........::::::...........
Jeff Surgeson / South Africa


More information about the solar-talk mailing list