Flesh out some more interface methods for the Channel Repository

This commit is contained in:
Dave Smith-Hayes 2024-06-27 22:33:38 -04:00
parent a7826d5056
commit 065f1a0cb1

View File

@ -90,10 +90,13 @@ class ChannelRepository implements ChannelRepositoryInterface
return $this->createChannelFromResults($results->resultRows[0]); return $this->createChannelFromResults($results->resultRows[0]);
} }
/**
* @throws Throwable
*/
public function create(Channel $channel, User $owner): int public function create(Channel $channel, User $owner): int
{ {
$query = "INSERT INTO channels $query = "INSERT INTO channels (name, slug, description, link,
(name, slug, description, link, language, copyright, explicit, owner_id) language, copyright, explicit, owner_id)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
$results = await($this->db->query($query, [ $results = await($this->db->query($query, [
@ -109,4 +112,14 @@ class ChannelRepository implements ChannelRepositoryInterface
return $results->insertId; return $results->insertId;
} }
public function update(Channel $channel): bool
{
$query = "UPDATE channels SET ";
}
public function delete(Channel $channel): bool
{
}
} }