diff --git a/php/src/db/Capacitor.php b/php/src/db/Capacitor.php index 4b3eb89..05404d0 100644 --- a/php/src/db/Capacitor.php +++ b/php/src/db/Capacitor.php @@ -143,6 +143,16 @@ class Capacitor implements ITransactor { return $this->storage->_charge($this->channel, $item, $func, $args, $row); } + function chargeAll(?iterable $items, $func=null, ?array $args=null): int { + $count = 0; + if ($items !== null) { + foreach ($items as $item) { + $count += $this->charge($item, $func, $args); + } + } + return $count; + } + function discharge(bool $reset=true): Traversable { return $this->storage->_discharge($this->channel, $reset); } diff --git a/php/src/db/CapacitorChannel.php b/php/src/db/CapacitorChannel.php index 8e2d089..ad384ca 100644 --- a/php/src/db/CapacitorChannel.php +++ b/php/src/db/CapacitorChannel.php @@ -444,6 +444,10 @@ class CapacitorChannel implements ITransactor { return $this->capacitor->charge($item, $func, $args, $row); } + function chargeAll(iterable $items, $func=null, ?array $args=null): int { + return $this->capacitor->chargeAll($items, $func, $args); + } + function discharge(bool $reset=true): Traversable { return $this->capacitor->discharge($reset); }