<?php
class Chat
{
	public static function GetLastMessage($nbr = 5)
	{
		return $GLOBALS['DB']->GetContent("chat", [], 'ORDER BY id DESC LIMIT '.$nbr);
	}

	public static function AddMessage($pseudo, $message, $date, $id)
	{
		$GLOBALS['DB']->Insert("chat", ["pseudo" => $pseudo, "message" => $message, "date" => $date, "userid" => $id]);
	}
	public static function DelChat()
	{
		$GLOBALS['DB']->Delete("chat");
	}

}
?>
