Class SloodleModuleChat

Description

The Sloodle chat module class.

Located in /lib/modules/module_chat.php (line 23)

SloodleModule
   |
   --SloodleModuleChat
Variable Summary
 object $cm
Method Summary
 SloodleModuleChat SloodleModuleChat ( &$_session)
 bool add_message (string $message, [mixed $user = null], [int $timestamp = null])
 array get_chat_history ([int $time = 60])
 mixed get_course_id ()
 string get_intro ()
 string get_name ()
 string get_type ()
 string get_type_full ()
 bool load (mixed $id)
Variables
object $cm = null (line 33)

Internal for Moodle only - course module instance.

Corresponds to one record from the Moodle 'course_modules' table.

  • access: private
object $moodle_chat_instance = null (line 41)

Internal only - Moodle chat module instance database object.

Corresponds to one record from the Moodle 'chat' table.

  • access: private

Inherited Variables

Inherited from SloodleModule

SloodleModule::$_session
Methods
Constructor SloodleModuleChat (line 50)

Constructor

SloodleModuleChat SloodleModuleChat ( &$_session)
  • &$_session
add_message (line 140)

Adds a new chat message.

Note: if the $author parameter is omitted or invalid, then the function will attempt to use the SloodleUser member of the current SloodleSession object; If that is unavailable, then it will try to use the user currently 'logged-in' to the VLE (i.e. the $USER variable in Moodle). If all else fails, it will attempt to attribute the message to the guest user.

  • return: True if successful, or false otherwise
bool add_message (string $message, [mixed $user = null], [int $timestamp = null])
  • string $message: The text of the message.
  • mixed $user: The user who wrote the message -- either a VLE user ID or (preferably) a SloodleUser object. If null, then the user in the current SloodleSession object will be used. At that fails, then the guest user is used if possible.
  • int $timestamp: Timestamp of the message. If omitted or <= 0 then the current timestamp is used
get_chat_history (line 94)

Gets a recent history of messages from the chatroom.

array get_chat_history ([int $time = 60])
  • int $time: How far back to search the database (in seconds) (default: 1 minute)
get_course_id (line 222)

Gets the identifier of the course this controller belongs to.

  • return: Course identifier. Type depends on VLE. (In Moodle, it will be an integer).
mixed get_course_id ()

Redefinition of:
SloodleModule::get_course_id()
Gets the identifier of the course this controller belongs to.
get_creation_time (line 231)

Gets the time at which this instance was created, or 0 if unknown.

  • return: Timestamp
int get_creation_time ()

Redefinition of:
SloodleModule::get_creation_time()
Gets the time at which this instance was created, or 0 if unknown.
get_intro (line 213)

Gets the intro description of this module instance, if available.

  • return: The intro description of this controller
string get_intro ()

Redefinition of:
SloodleModule::get_intro()
Gets the intro description of this module instance, if available.
get_modification_time (line 240)

Gets the time at which this instance was last modified, or 0 if unknown.

  • return: Timestamp
int get_modification_time ()

Redefinition of:
SloodleModule::get_modification_time()
Gets the time at which this instance was last modified, or 0 if unknown.
get_name (line 204)

Gets the name of this module instance.

  • return: The name of this controller
string get_name ()

Redefinition of:
SloodleModule::get_name()
Gets the name of this module instance.
get_type (line 250)

Gets the short type name of this instance.

string get_type ()

Redefinition of:
SloodleModule::get_type()
Gets the short type name of this instance.
get_type_full (line 260)

Gets the full type name of this instance, according to the current language pack, if available.

Note: should be overridden by sub-classes.

  • return: Full type name if possible, or the short name otherwise.
string get_type_full ()

Redefinition of:
SloodleModule::get_type_full()
Gets the full type name of this instance, according to the current language pack, if available.
load (line 62)

Loads data from the database.

Note: even if the function fails, it may still have overwritten some or all existing data in the object.

  • return: True if successful, or false otherwise
bool load (mixed $id)
  • mixed $id: The site-wide unique identifier for all modules. Type depends on VLE. On Moodle, it is an integer course module identifier ('id' field of 'course_modules' table)

Redefinition of:
SloodleModule::load()
Loads data from the database.

Inherited Methods

Inherited From SloodleModule

 SloodleModule::SloodleModule()
 SloodleModule::get_course_id()
 SloodleModule::get_creation_time()
 SloodleModule::get_intro()
 SloodleModule::get_modification_time()
 SloodleModule::get_name()
 SloodleModule::get_type()
 SloodleModule::get_type_full()
 SloodleModule::load()

Documentation generated on Mon, 07 Jul 2008 12:32:53 +0100 by phpDocumentor 1.4.0