1
0
mirror of synced 2025-01-22 08:11:40 +03:00

fixing #172 - copying a record now will set non-null fields to modified so that when it's saved it inserts correctly

This commit is contained in:
pookey 2006-10-16 21:08:14 +00:00
parent 5d8ac6d0a0
commit 83af818915

View File

@ -1118,7 +1118,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
* @return Doctrine_Record
*/
public function copy() {
return $this->_table->create($this->_data);
$ret = $this->_table->create($this->_data);
$modified = array();
foreach($this->_data as $key => $val)
if (!($val instanceof Doctrine_Null))
$ret->_modified[] = $key;
return $ret;
}
/**
* assignIdentifier