modifs.mineures sans commentaires
This commit is contained in:
parent
8fcf865bf0
commit
0d47b2a757
@ -227,6 +227,22 @@ abstract class CapacitorStorage {
|
|||||||
"class_name" => "varchar",
|
"class_name" => "varchar",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
function channelExists(string $name, ?array &$row=null): bool {
|
||||||
|
$row = $this->db()->one([
|
||||||
|
"select",
|
||||||
|
"from" => static::CHANNELS_TABLE,
|
||||||
|
"where" => ["name" => $name],
|
||||||
|
]);
|
||||||
|
return $row !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getChannels(): iterable {
|
||||||
|
return $this->db()->all([
|
||||||
|
"select",
|
||||||
|
"from" => static::CHANNELS_TABLE,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
protected function _createChannelsSql(): array {
|
protected function _createChannelsSql(): array {
|
||||||
return [
|
return [
|
||||||
"create table if not exists",
|
"create table if not exists",
|
||||||
|
@ -38,22 +38,6 @@ class SqliteStorage extends CapacitorStorage {
|
|||||||
return new _sqliteMigration($migrations, $channel->getName());
|
return new _sqliteMigration($migrations, $channel->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
function channelExists(string $name, ?array &$row=null): bool {
|
|
||||||
$row = $this->db->one([
|
|
||||||
"select",
|
|
||||||
"from" => static::CHANNELS_TABLE,
|
|
||||||
"where" => ["name" => $name],
|
|
||||||
]);
|
|
||||||
return $row !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getChannels(): iterable {
|
|
||||||
return $this->db->all([
|
|
||||||
"select",
|
|
||||||
"from" => static::CHANNELS_TABLE,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function _addToChannelsSql(CapacitorChannel $channel): array {
|
protected function _addToChannelsSql(CapacitorChannel $channel): array {
|
||||||
$sql = parent::_addToChannelsSql($channel);
|
$sql = parent::_addToChannelsSql($channel);
|
||||||
$sql[0] = "insert or ignore";
|
$sql[0] = "insert or ignore";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user