From 2f56a8bcadba40dc40f8f8b3ae5b133b3fff0487 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sat, 11 Dec 2010 01:28:46 +0000 Subject: [PATCH] ENHANCEMENT: added onBeforeVersionedPublish() hook. PATCH via muzdowski (#6016) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114813 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Versioned.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/model/Versioned.php b/core/model/Versioned.php index 956bb4a40..e1d47c242 100755 --- a/core/model/Versioned.php +++ b/core/model/Versioned.php @@ -533,6 +533,8 @@ class Versioned extends DataObjectDecorator { * @param createNewVersion Set this to true to create a new version number. By default, the existing version number will be copied over. */ function publish($fromStage, $toStage, $createNewVersion = false) { + $this->owner->extend('onBeforeVersionedPublish', $fromStage, $toStage, $createNewVersion); + $baseClass = $this->owner->class; while( ($p = get_parent_class($baseClass)) != "DataObject") $baseClass = $p; $extTable = $this->extendWithSuffix($baseClass);