2009年11月28日星期六

[fw-db] Select - insert Zend_Db_Row

Hi.

I tried (in my class which extends Zend_Db_Table_Abstract):

$row = $this->find($id)->current();
$row->setTable(new My_Model_History());
$row->save();

My_Model_History and current class have same mysql structure, identical
tables, one is active, and other I want to use for data history.

I got:

Zend_Db_Table_Row_Exception: Cannot refresh row as parent is missing
thrown in Zend\Db\Table\Row\Abstract.php on line 758

It works with:

$row = $this->find($id)->current();
$history = new My_Model_CarHistory();
$history->insert($row->toArray());

Is there a way to do it with sth similar to 1st example, or there is maybe
some other better option?

Regards,
Sasa Stamenkovic.
--
View this message in context: http://n4.nabble.com/Select-insert-Zend-Db-Row-tp930493p930493.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: