From: Tim Düsterhus Date: Wed, 9 Jul 2014 18:24:04 +0000 (+0200) Subject: Add delete to EditHistoryManager X-Git-Tag: 2.1.0_Alpha_1~590^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6a2487395a67e65dc352a67349b033fc641172a1;p=GitHub%2FWoltLab%2FWCF.git Add delete to EditHistoryManager --- diff --git a/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php b/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php index 7565eeeacb..a52f118a31 100644 --- a/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php +++ b/wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php @@ -63,4 +63,24 @@ class EditHistoryManager extends SingletonFactory { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($this->getObjectTypeID($objectType), $objectID, $message, $time, $userID, $username, $editReason)); } + + /** + * Deletes edit history entries. + * + * @param string $objectType + * @param array $objectIDs + */ + public function delete($objectType, array $objectIDs) { + $objectTypeID = $this->getObjectTypeID($objectType); + + $sql = "DELETE FROM wcf".WCF_N."_edit_history_entry + WHERE objectTypeID = ? + AND objectID = ?"; + $statement = WCF::getDB()->prepareStatement($sql); + WCF::getDB()->beginTransaction(); + foreach ($objectIDs as $objectID) { + $statement->execute(array($objectTypeID, $objectID)); + } + WCF::getDB()->commitTransaction(); + } }