diff options
author | Urban Müller | 2024-01-22 14:34:10 +0100 |
---|---|---|
committer | Urban Müller | 2024-01-22 14:34:10 +0100 |
commit | 31de739a6e72f3d24f67093eee5b15fc4f0daf64 (patch) | |
tree | de9fa97e34965b8bf9296728a07f537d5f800637 /it_dbi.class | |
parent | 6e0a397725d04e045e816c0f43fb6baef19341da (diff) | |
download | itools-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.class | 4 |
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()) |