Commit 83af8189 authored by pookey's avatar pookey

fixing #172 - copying a record now will set non-null fields to modified so...

fixing #172 - copying a record now will set non-null fields to modified so that when it's saved it inserts correctly
parent 5d8ac6d0
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment