Implement the update method
This commit is contained in:
parent
065f1a0cb1
commit
3d5050ef34
@ -113,13 +113,36 @@ class ChannelRepository implements ChannelRepositoryInterface
|
|||||||
return $results->insertId;
|
return $results->insertId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Channel $channel
|
||||||
|
* @return bool
|
||||||
|
* @throws Throwable
|
||||||
|
*/
|
||||||
public function update(Channel $channel): bool
|
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
|
public function delete(Channel $channel): bool
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user