|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| get_url () | |
| get_capabilities () | |
Static Public Member Functions | |
| static | get_class_for_level ($contextlevel) |
| static | get_all_levels () |
| static | cleanup_instances () |
| static | create_instances ($contextlevel=null, $buildpaths=true) |
| static | build_all_paths ($force=false) |
| static | reset_caches () |
| static | get_preload_record_columns ($tablealias) |
| static | get_preload_record_columns_sql ($tablealias) |
| static | preload_from_record (stdClass $rec) |
| static | preload_course ($courseid) |
| static | delete_instance ($contextlevel, $instanceid) |
| static | get_level_name ($contextlevel) |
Protected Member Functions | |
| __construct () | |
Context maintenance and helper methods.
This is "extends context" is a bloody hack that tires to work around the deficiencies in the "protected" keyword in PHP, this helps us to hide all the internals of context level implementation from the rest of code, the code completion returns what developers need.
Thank you Tim Hunt for helping me with this nasty trick.
Definition at line 5222 of file accesslib.php.
| __construct | ( | ) | [protected] |
Instance does not make sense here, only static use
Definition at line 5236 of file accesslib.php.
| static build_all_paths | ( | $ | force = false | ) | [static] |
Rebuild paths and depths in all context levels.
| bool | $force | false means add missing only |
Definition at line 5321 of file accesslib.php.


| static cleanup_instances | ( | ) | [static] |
Remove stale contexts that belonged to deleted instances. Ideally all code should cleanup contexts properly, unfortunately accidents happen...
Definition at line 5271 of file accesslib.php.


| static create_instances | ( | $ | contextlevel = null, |
| $ | buildpaths = true |
||
| ) | [static] |
Create all context instances at the given level and above.
| int | $contextlevel | null means all levels |
| bool | $buildpaths |
Definition at line 5301 of file accesslib.php.


| static delete_instance | ( | $ | contextlevel, |
| $ | instanceid | ||
| ) | [static] |
Delete context instance
| int | $contextlevel | |
| int | $instanceid |
Definition at line 5404 of file accesslib.php.


| static get_all_levels | ( | ) | [static] |
Returns a list of all context levels
Definition at line 5260 of file accesslib.php.

| get_capabilities | ( | ) |
| static get_class_for_level | ( | $ | contextlevel | ) | [static] |
Returns a class name of the context level class
| int | $contextlevel | (CONTEXT_SYSTEM, etc.) |
Definition at line 5246 of file accesslib.php.

| static get_level_name | ( | $ | contextlevel | ) | [static] |
Returns the name of specified context level
| int | $contextlevel |
Definition at line 5423 of file accesslib.php.


| static get_preload_record_columns | ( | $ | tablealias | ) | [static] |
Returns all fields necessary for context preloading from user $rec.
This helps with performance when dealing with hundreds of contexts.
| string | $tablealias | context table alias in the query |
Definition at line 5347 of file accesslib.php.

| static get_preload_record_columns_sql | ( | $ | tablealias | ) | [static] |
Returns all fields necessary for context preloading from user $rec.
This helps with performance when dealing with hundreds of contexts.
| string | $tablealias | context table alias in the query |
Definition at line 5360 of file accesslib.php.

| get_url | ( | ) |
| static preload_course | ( | $ | courseid | ) | [static] |
Preload all contexts instances from course.
To be used if you expect multiple queries for course activities...
| $courseid |
Definition at line 5385 of file accesslib.php.


| static preload_from_record | ( | stdClass $ | rec | ) | [static] |
Preloads context information from db record and strips the cached info.
The db request has to contain all columns from context_helper::get_preload_record_columns().
| stdClass | $rec |
Reimplemented from context.
Definition at line 5373 of file accesslib.php.

| static reset_caches | ( | ) | [static] |
Resets the cache to remove all data.
Reimplemented from context.
Definition at line 5334 of file accesslib.php.
