mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT Added new onBeforeDuplicate() and onAfterDuplicate() hooks to DataObject
This commit is contained in:
parent
9af805186b
commit
99355c0089
@ -416,11 +416,13 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
$clone = new $className( $this->record, false, $this->model );
|
||||
$clone->ID = 0;
|
||||
|
||||
$clone->extend('onBeforeDuplicate', $this, $doWrite);
|
||||
if($doWrite) {
|
||||
$clone->write();
|
||||
|
||||
$this->duplicateManyManyRelations($this, $clone);
|
||||
}
|
||||
$clone->extend('onAfterDuplicate', $this, $doWrite);
|
||||
|
||||
return $clone;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user