var $id_chatroom = 0;
var $id_course_instance = 0;
var $chat_type = "";
var $chat_moderator = "";
var $chat_title = "";
var $chat_topic = "";
var $max_users= 25;
var $welcome_msg = "";
var $start_time = 0;
var $end_time = 0;
var $error = "";
//main constructor function of the class ChatRoom;
function ChatRoom($id_chatroom)
{
//we check if the id_chatroom it is provided;
if($id_chatroom)
{
//if it is provided, we check if the chatroom allready exists;
$chatroom_ha = $this->get_chatroomFN($id_chatroom);
if ($chatroom_ha)
{
// the chatroom allready exists;
$this->chat_type = $chatroom_ha['chat_type'];
$this->chat_moderator = $chatroom_ha['chat_moderator'];
$this->chat_title = $chatroom_ha['chat_title'];
$this->chat_topic = $chatroom_ha['chat_topic'];
$this->max_users = $chatroom_ha['max_users'];
$this->welcome_msg = $chatroom_ha['welcome_msg'];
$this->start_time = $chatroom_ha['start_time'];
$this->end_time = $chatroom_ha['end_time'];
$this->id_course_instance = $chatroom_ha['id_course_instance'];
$this->id_chatroom = $chatroom_ha['id_chatroom'];
le proprietà qui sopra riportate sono anche all'interno della tabella chatroom nello DB,
devo inserire anche la proprietà error nello DB?
gli devo assegnare un valore qui sopra?
}
else
{
//error, the chatroom with such id_chatroom does not exist!
//so we proceed by creating a new chatroom;
$result_id = $this->add_chatroomFN();
if ($result_id)
{
//a new chatroom has succefully been created
$this->id_chatroom = $result_id;
}
else
{
//error the chatroom has not been created
$this->error =
}
}
}