From 905de5c8be2d667d3c144d795da1f32c9d224879 Mon Sep 17 00:00:00 2001 From: Jeffrey Reichardt Date: Sun, 30 Dec 2012 23:29:15 +0100 Subject: [PATCH] Renamed method and small changes --- .../data/VersionableDatabaseObjectAction.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php b/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php index bd49f93539..a267139916 100644 --- a/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php +++ b/wcfsetup/install/files/lib/data/VersionableDatabaseObjectAction.class.php @@ -16,7 +16,7 @@ abstract class VersionableDatabaseObjectAction extends AbstractDatabaseObjectAct /** * Validates restoring a version */ - public function validateRestore() { + public function validateRestoreRevision() { parent::validateUpdate(); } @@ -34,7 +34,7 @@ abstract class VersionableDatabaseObjectAction extends AbstractDatabaseObjectAct // get ids $objectIDs = array(); foreach ($this->objects as $object) { - $objectIDs[] = $object->__get($indexName); + $objectIDs[] = $object->getObjectID(); } // execute action @@ -68,7 +68,7 @@ abstract class VersionableDatabaseObjectAction extends AbstractDatabaseObjectAct $indexName = call_user_func(array($this->className, 'getDatabaseTableIndexName')); foreach ($this->objects as $object) { - call_user_func(array($this->className, 'createRevision'), array_merge($object->getData(), array($indexName =>$object->__get($indexName)))); + call_user_func(array($this->className, 'createRevision'), array_merge($object->getData(), array($indexName => $object->getObjectID()))); } } @@ -86,7 +86,7 @@ abstract class VersionableDatabaseObjectAction extends AbstractDatabaseObjectAct // get ids $objectIDs = array(); foreach ($this->objects as $object) { - $objectIDs[] = $object->__get($indexName); + $objectIDs[] = $object->getObjectID(); } // execute action @@ -96,14 +96,14 @@ abstract class VersionableDatabaseObjectAction extends AbstractDatabaseObjectAct /** * Restores a revision. */ - public function restore() { + public function restoreRevision() { if (empty($this->objects)) { $this->readObjects(); } // currently we only support restoring one version foreach ($this->objects as $object) { - $objectType = VersionHandler::getInstance()->getObjectTypeByName($object->objectTypeName); + $objectType = VersionHandler::getInstance()->getObjectTypeByName($object->versionableObjectTypeName); $restoreObject = VersionHandler::getInstance()->getVersionByID($objectType->objectTypeID, $this->parameters['restoreObjectID']); $this->parameters['data'] = $restoreObject->getData(); -- 2.20.1