Flesh out some more interface methods for the Channel Repository
This commit is contained in:
parent
a7826d5056
commit
065f1a0cb1
@ -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
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user