From 065f1a0cb14a5aa97aee9b19b0c12863937e53af Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Thu, 27 Jun 2024 22:33:38 -0400 Subject: [PATCH] Flesh out some more interface methods for the Channel Repository --- .../Repository/Channel/ChannelRepository.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/src/Domain/Repository/Channel/ChannelRepository.php b/app/src/Domain/Repository/Channel/ChannelRepository.php index fa6b199..d381932 100644 --- a/app/src/Domain/Repository/Channel/ChannelRepository.php +++ b/app/src/Domain/Repository/Channel/ChannelRepository.php @@ -90,10 +90,13 @@ class ChannelRepository implements ChannelRepositoryInterface return $this->createChannelFromResults($results->resultRows[0]); } + /** + * @throws Throwable + */ public function create(Channel $channel, User $owner): int { - $query = "INSERT INTO channels - (name, slug, description, link, language, copyright, explicit, owner_id) + $query = "INSERT INTO channels (name, slug, description, link, + language, copyright, explicit, owner_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; $results = await($this->db->query($query, [ @@ -109,4 +112,14 @@ class ChannelRepository implements ChannelRepositoryInterface return $results->insertId; } + + public function update(Channel $channel): bool + { + $query = "UPDATE channels SET "; + } + + public function delete(Channel $channel): bool + { + + } }