diff --git a/php/src/db/CapacitorStorage.php b/php/src/db/CapacitorStorage.php index e7ff6af..ba00c07 100644 --- a/php/src/db/CapacitorStorage.php +++ b/php/src/db/CapacitorStorage.php @@ -677,7 +677,7 @@ abstract class CapacitorStorage { function _delete(CapacitorChannel $channel, $filter, $func, ?array $args): int { $this->_create($channel); if ($func === null) $func = CapacitorChannel::onDelete; - $onEach = func::with($func)->bind($channel); + $onDelete = func::with($func)->bind($channel); $db = $this->db(); # si on est déjà dans une transaction, désactiver la gestion des transactions $manageTransactions = $channel->isManageTransactions() && !$db->inTransaction(); @@ -693,8 +693,8 @@ abstract class CapacitorStorage { $all = $this->_allCached("delete", $channel, $filter); foreach ($all as $values) { $rowIds = $this->getRowIds($channel, $values); - $delete = boolval($onEach->invoke([$values["item"], $values, ...$args])); - if ($delete) { + $shouldDelete = boolval($onDelete->invoke([$values["item"], $values, ...$args])); + if ($shouldDelete) { $db->exec([ "delete", "from" => $tableName,