Comment content can be updated.

This commit is contained in:
Pierre
2018-01-27 18:19:30 +01:00
parent 00c61345d8
commit ddd0421592
2 changed files with 70 additions and 0 deletions

View File

@ -153,6 +153,29 @@ class Comments {
}
/**
* Edit a comment content
*
* @param int $commentID The ID of the comment to update
* @param string $content The new content for the comment
* @return bool TRUE for a success / FALSE else
*/
public function edit(int $commentID, string $content) : bool {
//Perform a request on the database
$newValues = array(
"commentaire" => $content
);
//Try to perform request
return CS::get()->db->updateDB(
$this::COMMENTS_TABLE,
"ID = ?",
$newValues,
array($commentID));
}
/**
* Get the ID of the post associated to a comment
*