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
This commit is contained in:
Will Rossiter 2010-12-11 01:28:46 +00:00
parent 63d2971158
commit 2f56a8bcad

View File

@ -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);