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:
parent
5d8ac6d0a0
commit
83af818915
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user