From 31de739a6e72f3d24f67093eee5b15fc4f0daf64 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 22 Jan 2024 14:34:10 +0100 Subject: warn about incorrect usage --- it_dbi.class | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/it_dbi.class b/it_dbi.class index 41054c7..0af1273 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -892,7 +892,9 @@ function delete($query = null) */ function delete_untouched($query = null, $p = []) { - if (count((array)$this->_touchedids) < $p['mintouched']) + if (isset($query['mintouched'])) + it::error('bad usage'); + else if (count((array)$this->_touchedids) < $p['mintouched']) it::error((array)$p['it_error'] + ['title' => "skipping delete, only " . count((array)$this->_touchedids) . " records were touched"]); else if ($this->select(['SELECT' => $this->escape_name($this->_p['keyfield'])] + (array)$query)) while ($this->iterate()) -- cgit v1.2.3