modifs.mineures sans commentaires
This commit is contained in:
parent
1f68c4bac4
commit
43c53b286a
@ -177,11 +177,12 @@ class A {
|
||||
return $pvalue;
|
||||
}
|
||||
|
||||
static final function shift(?array &$dest, int $count=1) {
|
||||
static final function shift(?array &$dest, int $count=1, $default=null) {
|
||||
if ($dest === null) return null;
|
||||
$values = array_slice($dest, 0, $count);
|
||||
$dest = array_slice($dest, $count);
|
||||
return $count == 1? $values[0]: $values;
|
||||
if ($values === []) return $default;
|
||||
else return $count == 1? $values[0]: $values;
|
||||
}
|
||||
|
||||
static final function pop(&$dest, $key, $default=null) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace nulib\db;
|
||||
|
||||
use nulib\cl;
|
||||
use nulib\php\func;
|
||||
use nulib\ValueException;
|
||||
use Traversable;
|
||||
@ -168,6 +169,13 @@ class Capacitor implements ITransactor {
|
||||
return $this->storage->_delete($this->channel, $filter, $func, $args);
|
||||
}
|
||||
|
||||
function dbUpdate(array $update) {
|
||||
return $this->storage->db()->exec(cl::merge([
|
||||
"update",
|
||||
"table" => $this->getTableName(),
|
||||
], $update));
|
||||
}
|
||||
|
||||
function close(): void {
|
||||
$this->storage->close();
|
||||
}
|
||||
|
@ -482,6 +482,10 @@ class CapacitorChannel implements ITransactor {
|
||||
return $this->capacitor->delete($filter, $func, $args);
|
||||
}
|
||||
|
||||
function dbUpdate(array $update) {
|
||||
return $this->capacitor->dbUpdate($update);
|
||||
}
|
||||
|
||||
function close(): void {
|
||||
$this->capacitor->close();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user