mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: added hooks for extending duplicate page functionality
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96877 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3b88d34230
commit
a6da69818b
@ -503,11 +503,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
* @return SiteTree The duplicated object.
|
||||
*/
|
||||
public function duplicate($doWrite = true) {
|
||||
|
||||
$this->extend('onBeforeDuplicate', $page);
|
||||
$page = parent::duplicate(false);
|
||||
$page->Sort = 0;
|
||||
if($doWrite) {
|
||||
$page->write();
|
||||
}
|
||||
$this->extend('onAfterDuplicate', $page);
|
||||
return $page;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user