mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Comment content can be updated.
This commit is contained in:
		@@ -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
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user