cosmetic
This commit is contained in:
parent
a371a68ee2
commit
aabdb3f765
@ -677,7 +677,7 @@ abstract class CapacitorStorage {
|
|||||||
function _delete(CapacitorChannel $channel, $filter, $func, ?array $args): int {
|
function _delete(CapacitorChannel $channel, $filter, $func, ?array $args): int {
|
||||||
$this->_create($channel);
|
$this->_create($channel);
|
||||||
if ($func === null) $func = CapacitorChannel::onDelete;
|
if ($func === null) $func = CapacitorChannel::onDelete;
|
||||||
$onEach = func::with($func)->bind($channel);
|
$onDelete = func::with($func)->bind($channel);
|
||||||
$db = $this->db();
|
$db = $this->db();
|
||||||
# si on est déjà dans une transaction, désactiver la gestion des transactions
|
# si on est déjà dans une transaction, désactiver la gestion des transactions
|
||||||
$manageTransactions = $channel->isManageTransactions() && !$db->inTransaction();
|
$manageTransactions = $channel->isManageTransactions() && !$db->inTransaction();
|
||||||
@ -693,8 +693,8 @@ abstract class CapacitorStorage {
|
|||||||
$all = $this->_allCached("delete", $channel, $filter);
|
$all = $this->_allCached("delete", $channel, $filter);
|
||||||
foreach ($all as $values) {
|
foreach ($all as $values) {
|
||||||
$rowIds = $this->getRowIds($channel, $values);
|
$rowIds = $this->getRowIds($channel, $values);
|
||||||
$delete = boolval($onEach->invoke([$values["item"], $values, ...$args]));
|
$shouldDelete = boolval($onDelete->invoke([$values["item"], $values, ...$args]));
|
||||||
if ($delete) {
|
if ($shouldDelete) {
|
||||||
$db->exec([
|
$db->exec([
|
||||||
"delete",
|
"delete",
|
||||||
"from" => $tableName,
|
"from" => $tableName,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user