From 641f07913a09fb0595d7066a98584632b1866829 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 21 Mar 2012 13:50:11 +0100 Subject: [PATCH] Fixes DatabaseObjectEditor::deleteAll() return value This way the number of deleted objects is returned and not the number of given object ids. --- .../install/files/lib/data/DatabaseObjectEditor.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php index 7aa1d1b59f..fb5bce8d15 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php @@ -106,12 +106,14 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I WHERE ".static::getDatabaseTableIndexName()." = ?"; $statement = WCF::getDB()->prepareStatement($sql); + $affectedCount = 0; WCF::getDB()->beginTransaction(); foreach ($objectIDs as $objectID) { $statement->executeUnbuffered(array($objectID)); + $affectedCount += $statement->getAffectedRows(); } WCF::getDB()->commitTransaction(); - return count($objectIDs); + return $affectedCount; } } -- 2.20.1