From: Matthias Schmidt Date: Wed, 21 Mar 2012 12:50:11 +0000 (+0100) Subject: Fixes DatabaseObjectEditor::deleteAll() return value X-Git-Tag: 2.0.0_Beta_1~1197^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=641f07913a09fb0595d7066a98584632b1866829;p=GitHub%2FWoltLab%2FWCF.git Fixes DatabaseObjectEditor::deleteAll() return value This way the number of deleted objects is returned and not the number of given object ids. --- 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; } }