Skip to content

Commit 7a22a16

Browse files
authored
Fix(Model): fix clean function (#543)
* Fix(Model): fix clean function * refactor
1 parent 060fadd commit 7a22a16

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111

1212
- Remove groups as import link field
13+
- Fix `clean` function
1314

1415
## [2.15.1] - 2025-10-14
1516

inc/model.class.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,7 @@ public static function clean($crit = [])
837837
$model = new self();
838838

839839
if ((count($crit) > 0)) {
840-
$crit['FIELDS'] = 'id';
841-
foreach ($DB->doQuery($model->getTable()) as $row) {
842-
$model->delete($row);
843-
}
840+
$model->deleteByCriteria($crit);
844841
}
845842
}
846843

0 commit comments

Comments
 (0)