summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorUrban Müller2024-01-22 14:34:10 +0100
committerUrban Müller2024-01-22 14:34:10 +0100
commit31de739a6e72f3d24f67093eee5b15fc4f0daf64 (patch)
treede9fa97e34965b8bf9296728a07f537d5f800637 /it_dbi.class
parent6e0a397725d04e045e816c0f43fb6baef19341da (diff)
downloaditools-31de739a6e72f3d24f67093eee5b15fc4f0daf64.tar.gz
itools-31de739a6e72f3d24f67093eee5b15fc4f0daf64.tar.bz2
itools-31de739a6e72f3d24f67093eee5b15fc4f0daf64.zip
warn about incorrect usage
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class4
1 files changed, 3 insertions, 1 deletions
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())