Moodle  2.2.1
http://www.collinsharper.com
course_request Class Reference

Public Member Functions

 __construct ($properties)
 __get ($key)
 __isset ($key)
 get_requester ()
 check_shortname_collision ($shortnamemark= '[*]')
 approve ()
 reject ($notice)
 delete ()

Static Public Member Functions

static prepare ($data=null)
static create ($data)
static summary_editor_options ()

Protected Member Functions

 notify ($touser, $fromuser, $name='courserequested', $subject, $message)

Protected Attributes

 $properties

Static Protected Attributes

static $summaryeditoroptions

Detailed Description

Definition at line 4011 of file lib.php.


Constructor & Destructor Documentation

__construct ( properties)

Loads the properties for this course request object. Id is required and if only id is provided then we load the rest of the properties from the database

Parameters:
stdClass | int$propertiesEither an object containing properties or the course_request id to load

Definition at line 4107 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

__get ( key)

Returns the requested property

Parameters:
string$key
Returns:
mixed

Definition at line 4134 of file lib.php.

__isset ( key)

Override this to ensure empty($request->blah) calls return a reliable answer...

This is required because we define the __get method

Parameters:
mixed$key
Returns:
bool True is it not empty, false otherwise

Definition at line 4146 of file lib.php.

approve ( )

This function approves the request turning it into a course

This function converts the course request into a course, at the same time transferring any files used in the summary to the new course and then removing the course request and the files associated with it.

Returns:
int The id of the course that was created from this request

Definition at line 4205 of file lib.php.

Here is the call graph for this function:

check_shortname_collision ( shortnamemark = '[*]')

Checks that the shortname used by the course does not conflict with any other courses that exist

Parameters:
string | null$shortnamemarkThe string to append to the requests shortname should a conflict be found
Returns:
bool true is there is a conflict, false otherwise

Definition at line 4175 of file lib.php.

Here is the call graph for this function:

static create ( data) [static]

Static function to create a new course request when passed an array of properties for it.

This function also handles saving any files that may have been used in the editor

Parameters:
stdClass$data
Returns:
course_request The newly created course request

Definition at line 4057 of file lib.php.

Here is the call graph for this function:

delete ( )

Deletes the course request and any associated files

Definition at line 4286 of file lib.php.

Returns the user who requested this course

Uses a static var to cache the results and cut down the number of db queries

array $requesters An array of cached users

Returns:
stdClass The user who requested the course

Definition at line 4158 of file lib.php.

notify ( touser,
fromuser,
name = 'courserequested',
subject,
message 
) [protected]

Send a message from one user to another using events_trigger

Parameters:
object$touser
object$fromuser
string$name
string$subject
string$message

Definition at line 4300 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static prepare ( data = null) [static]

Static function to prepare the summary editor for working with a course request.

Parameters:
null | stdClass$dataOptional, an object containing the default values for the form, these may be modified when preparing the editor so this should be called before creating the form
Returns:
stdClass An object that can be used to set the default values for an mforms form

Definition at line 4039 of file lib.php.

Here is the call graph for this function:

reject ( notice)

Reject a course request

This function rejects a course request, emailing the requesting user the provided notice and then removing the request from the database

Parameters:
string$noticeThe message to display to the user

Definition at line 4276 of file lib.php.

Here is the call graph for this function:

static summary_editor_options ( ) [static]

Returns an array of options to use with a summary editor

course_request::$summaryeditoroptions

Returns:
array An array of options to use with the editor

Definition at line 4092 of file lib.php.

Here is the caller graph for this function:


Field Documentation

$properties [protected]

Definition at line 4018 of file lib.php.

$summaryeditoroptions [static, protected]

Definition at line 4026 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations