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

Public Member Functions

 __construct ($data=null)
 __set ($key, $value)
 __get ($key)
 __isset ($key)
 count_repeats ()
 update ($data, $checkcapability=true)
 delete ($deleterepeated=false)
 properties ($prepareeditor=false)
 toggle_visibility ($force=null)

Static Public Member Functions

static calendar_event_hook ($action, array $args)
static load ($param)
static create ($properties)

Protected Member Functions

 calculate_context (stdClass $data)
 get_editoroptions ()
 get_description ()

Protected Attributes

 $properties = null
 $_description = null
 $editoroptions
 $editorcontext = null

Detailed Description

Definition at line 1659 of file lib.php.


Constructor & Destructor Documentation

__construct ( data = null)

Instantiates a new event and optionally populates its properties with the data provided

Parameters:
stdClass$dataOptional. An object containing the properties to for an event

Definition at line 1696 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

__get ( key)

Magic get method

Attempts to call a get_$key method to return the property and ralls over to return the raw property

Parameters:
str$key
Returns:
mixed

Definition at line 1768 of file lib.php.

__isset ( key)

Stupid PHP needs an isset magic method if you use the get magic method and still want empty calls to work.... blah ~!

Parameters:
string$key
Returns:
bool

Definition at line 1785 of file lib.php.

__set ( key,
value 
)

Magic property method

Attempts to call a set_$key method if one exists otherwise falls back to simply set the property

Parameters:
string$key
mixed$value

Definition at line 1752 of file lib.php.

Here is the call graph for this function:

calculate_context ( stdClass $  data) [protected]

Calculate the context value needed for calendar_event. Event's type can be determine by the available value store in $data It is important to check for the existence of course/courseid to determine the course event. Default value is set to CONTEXT_USER

Returns:
stdClass

Definition at line 1798 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static calendar_event_hook ( action,
array args 
) [static]

Attempts to call the hook for the specified action should a calendar type by set $CFG->calendar, and the appopriate function defined

bool $extcalendarinc Used to track the inclusion of the calendar lib

Parameters:
string$actionOne of `update_event`, `add_event`, `delete_event`, `show_event`, `hide_event`
array$argsThe args to pass to the hook, usually the event is the first element
Returns:
bool

Definition at line 2250 of file lib.php.

Return the number of repeat events there are in this events series

Returns:
int

Definition at line 1876 of file lib.php.

static create ( properties) [static]

Creates a new event and returns a calendar_event object

Parameters:
object | array$propertiesAn object containing event properties
Returns:
calendar_event|false The event object or false if it failed

Definition at line 2298 of file lib.php.

Here is the caller graph for this function:

delete ( deleterepeated = false)

Deletes an event and if selected an repeated events in the same series

This function deletes an event, any associated events if $deleterepeated=true, and cleans up any files associated with the events.

See also:
delete_event()
Parameters:
bool$deleterepeated
Returns:
bool

Definition at line 2078 of file lib.php.

Here is the call graph for this function:

get_description ( ) [protected]

Returns an event description: Called by __get Please use $blah = $event->description;

Returns:
string

Definition at line 1837 of file lib.php.

Here is the call graph for this function:

get_editoroptions ( ) [protected]

Returns an array of editoroptions for this event: Called by __get Please use $blah = $event->editoroptions;

Returns:
array

Definition at line 1827 of file lib.php.

static load ( param) [static]

Returns a calendar_event object when provided with an event id

This function makes use of MUST_EXIST, if the event id passed in is invalid it will result in an exception being thrown

Parameters:
int | object$param
Returns:
calendar_event|false

Definition at line 2281 of file lib.php.

Here is the caller graph for this function:

properties ( prepareeditor = false)

Fetch all event properties

This function returns all of the events properties as an object and optionally can prepare an editor for the description field at the same time. This is designed to work when the properties are going to be used to set the default values of a moodle forms form.

Parameters:
bool$prepareeditorIf set to true a editor is prepared for use with the mforms editor element. (for description)
Returns:
stdClass Object containing event properties

Definition at line 2134 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

toggle_visibility ( force = null)

Toggles the visibility of an event

Parameters:
null | bool$forceIf it is left null the events visibility is flipped, If it is false the event is made hidden, if it is true it is made visible.

Definition at line 2216 of file lib.php.

update ( data,
checkcapability = true 
)

Update or create an event within the database

Pass in a object containing the event properties and this function will insert it into the database and deal with any associated files

See also:
add_event()
update_event()
Parameters:
stdClass$data
boolean$checkcapabilityif moodle should check calendar managing capability or not

Definition at line 1898 of file lib.php.

Here is the call graph for this function:


Field Documentation

$_description = null [protected]

Definition at line 1672 of file lib.php.

$editorcontext = null [protected]

Definition at line 1687 of file lib.php.

$editoroptions [protected]
Initial value:
 array(
            'subdirs'=>false,
            'forcehttps'=>false,
            'maxfiles'=>-1,
            'maxbytes'=>null,
            'trusttext'=>false)

Definition at line 1677 of file lib.php.

$properties = null [protected]

Definition at line 1666 of file lib.php.


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