mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
remove Created field on duplicate
This commit is contained in:
parent
2918463619
commit
eecdf56b36
@ -531,7 +531,9 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
*/
|
*/
|
||||||
public function duplicate($doWrite = true) {
|
public function duplicate($doWrite = true) {
|
||||||
$className = $this->class;
|
$className = $this->class;
|
||||||
$clone = new $className( $this->toMap(), false, $this->model );
|
$map = $this->toMap();
|
||||||
|
unset($map['Created']);
|
||||||
|
$clone = new $className( $map, false, $this->model );
|
||||||
$clone->ID = 0;
|
$clone->ID = 0;
|
||||||
|
|
||||||
$clone->invokeWithExtensions('onBeforeDuplicate', $this, $doWrite);
|
$clone->invokeWithExtensions('onBeforeDuplicate', $this, $doWrite);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user