Permalink
Browse files

API CHANGE Moved SiteTree->doRollbackTo() to Versioned class

  • Loading branch information...
1 parent 5021311 commit 3f3f0f6211933dd36823ee3141bf83727929652a @chillu chillu committed Mar 23, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 core/model/Versioned.php
View
@@ -875,6 +875,17 @@ function writeToStage($stage, $forceInsert = false) {
Versioned::set_reading_mode($oldMode);
return $result;
}
+
+ /**
+ * Roll the draft version of this page to match the published page.
+ * Caution: Doesn't overwrite the object properties with the rolled back version.
+ *
+ * @param $version Either the string 'Live' or a version number
+ */
+ function doRollbackTo($version) {
+ $this->publish($version, "Stage", true);
+ $this->owner->writeWithoutVersion();
+ }
/**
* Build a SQL query to get data from the _version table.

0 comments on commit 3f3f0f6

Please sign in to comment.