mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
Fixed regression - still, the API MetaModel::BulkDelete cannot be used in any case (e.g. hierarchical keys)
SVN:trunk[2256]
This commit is contained in:
@@ -4827,10 +4827,17 @@ abstract class MetaModel
|
|||||||
return $iNextKey;
|
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)
|
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);
|
$sSQL = self::MakeDeleteQuery($oFilter);
|
||||||
if (!self::DBIsReadOnly())
|
if (!self::DBIsReadOnly())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user