From c78196450e6609181e33935577ebf4a828a8be03 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Tue, 6 May 2025 17:03:07 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- php/src/db/sqlite/SqliteStorage.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/php/src/db/sqlite/SqliteStorage.php b/php/src/db/sqlite/SqliteStorage.php index 4621cb2..7495b46 100644 --- a/php/src/db/sqlite/SqliteStorage.php +++ b/php/src/db/sqlite/SqliteStorage.php @@ -40,12 +40,20 @@ class SqliteStorage extends CapacitorStorage { return new _sqliteMigration($migrations, $channel->getName()); } - function channelExists(string $name): bool { - return null !== $this->db->get([ - "select name", + 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 {