From a79336116fd1c146efd5c91095d9a2631a4dd941 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Mon, 15 Oct 2012 13:57:19 +0000 Subject: [PATCH] Fixed regression - still, the API MetaModel::BulkDelete cannot be used in any case (e.g. hierarchical keys) SVN:trunk[2256] --- core/metamodel.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 9a0aa51b13..2340e49120 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -4827,10 +4827,17 @@ abstract class MetaModel return $iNextKey; } + /** + * Deletion of records, bypassing DBObject::DBDelete !!! + * It is NOT recommended to use this shortcut + * In particular, it will not work + * - if the class is not a final class + * - if the class has a hierarchical key (need to rebuild the indexes) + * - if the class overload DBDelete ! + * Todo: protect it against forbidden usages (in such a case, delete objects one by one) + */ public static function BulkDelete(DBObjectSearch $oFilter) { - throw new Exception("Bulk deletion cannot be done this way: it will not work with hierarchical keys - implementation to be reviewed!"); - $sSQL = self::MakeDeleteQuery($oFilter); if (!self::DBIsReadOnly()) {