Class SloodleController

Description

Represents a Sloodle Controller, including data such as prim password.

Located in /sloodle/lib/controller.php (line 25)


	
			
Variable Summary
Method Summary
 SloodleController SloodleController ()
 bool authorise_object (string $uuid, SloodleUser $user, [string $type = null])
 bool check_authorisation (string $uuid, string $password)
 void disable ()
 void enable ()
 mixed|bool get_authorizing_user ( $uuid)
 mixed get_course_id ()
 mixed get_id ()
 string get_intro ()
 string get_name ()
 SloodleActiveObject|bool get_object (mixed $id)
 array get_object_configuration (mixed $id)
 string get_password ()
 bool is_available ()
 bool is_enabled ()
 bool is_loaded ()
 bool load (mixed $id)
 bool ping_object (mixed $id)
 int|bool register_object (string $uuid, string $name, SloodleUser $user, string $password, [string $type = ''], [int $timestamp = null])
 int|bool register_unauth_object (string $uuid, string $name, string $password, [string $type = ''], [int $timestamp = null])
 void remove_object (mixed $id)
 void set_intro (string $intro)
 void set_name (string $name)
 bool set_password (string $password)
 bool update_object_type (string $uuid, string $type)
 bool write ()
Variables
object $cm = null (line 35)

Internal for Moodle only - course module instance.

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

  • access: private
object $sloodle_controller_instance = null (line 51)

Internal only - Sloodle Controller instance database object.

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

  • access: private
object $sloodle_module_instance = null (line 43)

Internal only - Sloodle module instance database object.

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

  • access: private
Methods
Constructor SloodleController (line 59)

Constructor

SloodleController SloodleController ()
authorise_object (line 404)

Authorises an otherwise unauthorised active object against the given user and the current controller.

(NOTE: the object must previously have been registered using register_object()). Must not be called statically.

  • return: True if successful, or false if not
bool authorise_object (string $uuid, SloodleUser $user, [string $type = null])
  • string $uuid: The UUID of the object being updated
  • SloodleUser $user: The user to authorise the object against
  • string $type: (Optional). Specifies the type to store for this object. Ignored if null.
check_authorisation (line 424)

Checks if the specified object is authorised for this controller with the given password.

  • return: True if object is authorised, or false if not
bool check_authorisation (string $uuid, string $password)
  • string $uuid: The UUID of the object to check
  • string $password: The password to check
disable (line 250)

Disables this controller

void disable ()
enable (line 241)

Enables this controller

void enable ()
get_authorizing_user (line 440)

Gets the ID of the user who authorised the specified object.

  • return: Returns the user ID if successful, or FALSE if not
mixed|bool get_authorizing_user ( $uuid)
  • $uuid
get_controller_id (line 148)

Gets the identifier for controller (unique among all Sloodle controlers - may be the same as get_id() in some environments

  • return: Identifier. Type is dependent on VLE. On Moodle, it is an integer relating to the 'id' field of the 'sloodle_controller' table
mixed get_controller_id ()
get_course_id (line 195)

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 ()
get_creation_time (line 204)

Gets the time at which this controller was created.

  • return: Timestamp
int get_creation_time ()
get_id (line 139)

Gets the site-wide unique identifier for this module.

  • return: Identifier. Type is dependent on VLE. On Moodle, it is an integer course module identifier.
mixed get_id ()
get_intro (line 176)

Gets the intro description of this controller.

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

Gets the time at which this controller was last modified.

  • return: Timestamp
int get_modification_time ()
get_name (line 157)

Gets the name of this controller.

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

Gets data about an active object.

  • return: Returns false on failure
SloodleActiveObject|bool get_object (mixed $id)
  • mixed $id: If an integer, it is the ID of an active object. If it is a string it is the object's UUID.
get_object_configuration (line 506)

Gets an array of object configuration settings.

(Can be called statically).

  • return: Associative array of setting names to values. (Returns an empty array if unsuccessful.)
array get_object_configuration (mixed $id)
  • mixed $id: If an integer, it is the ID of an active object. If it is a string it is the object's UUID.
get_password (line 259)

Gets the prim password of this controller.

  • return: The current prim password.
string get_password ()
is_available (line 223)

Determines whether or not this controller is available (i.e. not hidden).

Note: this is separate from being enabled or disabled.

  • return: True if the controller is available.
bool is_available ()
is_enabled (line 232)

Determines if this controller is enabled or not.

  • return: True if the controller is enabled, or false otherwise.
bool is_enabled ()
is_loaded (line 129)

Determines whether or not this controller is loaded.

bool is_loaded ()
load (line 70)

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)
ping_object (line 530)

Updates the last active timer on an object.

(Cannot be called statically... object must be authorised for this controller).

  • return: True if successful, or false if not.
bool ping_object (mixed $id)
  • mixed $id: If an integer, it is the ID of an active object. If it is a string it is the object's UUID.
register_object (line 290)

Registers a new active object (or renew an existing authorisation) with this controller.

  • return: The new authorisation ID if successful, or false if not
int|bool register_object (string $uuid, string $name, SloodleUser $user, string $password, [string $type = ''], [int $timestamp = null])
  • string $uuid: The UUID of the object to be registered
  • string $name: Name of the object to be registered
  • SloodleUser $user: The user who is authorising the object
  • string $password: The password for the object
  • string $type: Type identifier of the object to be registered
  • int $timestamp: The timestamp of the object's registration, or null to use the current time.
register_unauth_object (line 341)

Registers a new unauthorised object.

(Can be called statically). Creates a new active object entry, not linked to any user or controller.

  • return: The integer ID of the active object entry, or false if not
int|bool register_unauth_object (string $uuid, string $name, string $password, [string $type = ''], [int $timestamp = null])
  • string $uuid: The UUID of the object to be registered
  • string $name: Name of the object to be registered
  • string $password: The password for the object
  • string $type: Type identifier of the object to be registered
  • int $timestamp: The timestamp of the object's registration, or null to use the current time.
remove_object (line 454)

Removes an active object and all its related items.

void remove_object (mixed $id)
  • mixed $id: If it is an integer, then it is treated as the active object ID. If a string, it is treated as the object UUID.
set_intro (line 186)

Sets the intro description of this controller.

void set_intro (string $intro)
  • string $intro: The new intro for this controller - ignored if empty
set_name (line 167)

Sets the name of this controller.

void set_name (string $name)
  • string $name: The new name for this controller - ignored if empty
set_password (line 270)

Sets the prim password of this controller.

Also checks for validity before storing.

  • return: True if successfully stored, or false if the password is invalid
bool set_password (string $password)
  • string $password: The new prim password
update_object_type (line 383)

Updates the type of a given active object to the specified type.

  • return: True if successful, or false if not
bool update_object_type (string $uuid, string $type)
  • string $uuid: The UUID of the object being updated
  • string $type: Name of the new type identifier
write (line 108)

Updates the currently loaded entry in the database.

Note: the data *must* have been previously loaded using load_from_db(). This function cannot be used to create new entries.

  • return: True if successful, or false otherwise
bool write ()

Documentation generated on Mon, 16 Jun 2008 15:56:14 +0100 by phpDocumentor 1.4.0