ENHANCEMENT Added new onBeforeDuplicate() and onAfterDuplicate() hooks to DataObject

This commit is contained in:
Ingo Schommer 2011-09-09 14:31:03 +02:00
parent 9af805186b
commit 99355c0089

View File

@ -415,12 +415,14 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
$className = $this->class;
$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;
}