diff --git a/inc/target_actor.class.php b/inc/target_actor.class.php index 382a91182..98ba1eb27 100644 --- a/inc/target_actor.class.php +++ b/inc/target_actor.class.php @@ -231,4 +231,15 @@ public function export($remove_uuid = false) { return $target_actor; } + + public function deleteObsoleteItems(CommonDBTM $container, array $exclude) + { + $keepCriteria = [ + self::$items_id => $container->getID(), + ]; + if (count($exclude) > 0) { + $keepCriteria[] = ['NOT' => ['id' => $exclude]]; + } + return $this->deleteByCriteria($keepCriteria); + } }