diff --git a/app/src/Domain/Repository/Channel/ChannelRepository.php b/app/src/Domain/Repository/Channel/ChannelRepository.php index d381932..1f06d86 100644 --- a/app/src/Domain/Repository/Channel/ChannelRepository.php +++ b/app/src/Domain/Repository/Channel/ChannelRepository.php @@ -113,13 +113,36 @@ class ChannelRepository implements ChannelRepositoryInterface return $results->insertId; } + /** + * @param Channel $channel + * @return bool + * @throws Throwable + */ public function update(Channel $channel): bool { - $query = "UPDATE channels SET "; + $query = "UPDATE channels SET name = ?, + slug = ?, + description = ?, + link = ?, + language = ?, + copyright = ?, + explicit = ?"; + + $results = await($this->db->query($query, [ + $channel->getName(), + $channel->getSlug(), + $channel->getDescription(), + $channel->getLink(), + $channel->getLanguage(), + $channel->getCopyright(), + $channel->isExplicit(), + ])); + + return (bool) $results->affectedRows; } public function delete(Channel $channel): bool { - + return false; } }