我在尝试保存时收到错误"无法刷新行,因为父项丢失".这是我的代码
abstract class Webapp_Model_Resource_Db_Table_Abstract
extends Zend_Db_Table_Abstract
{
/**
* Save a row to the database
*
*
* @param array $info The data to insert/update
* @param Zend_DB_Table_Row $row Optional The row to use
* @return mixed The primary key
*/
public function saveRow($info, $row = null)
{
if (null === $row) {
$row = $this->createRow();
}
$columns = $this->info('cols');
foreach ($columns as $column) {
if (array_key_exists($column, $info)) {
$row->$column = $info[$column];
}
}
return $row->save();
}
}
Run Code Online (Sandbox Code Playgroud)
当我调用saveRow()方法时,我传入$ _POST值($ …