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

Public Member Functions | |
| __set ($name, $value) | |
| __get ($name) | |
| __isset ($name) | |
| __unset ($name) | |
| update_moved (context $newparent) | |
| reset_paths ($rebuild=true) | |
| delete_content () | |
| delete () | |
| get_context_name ($withprefix=true, $short=false) | |
| get_url () | |
| get_capabilities () | |
| get_child_contexts () | |
| get_parent_contexts ($includeself=false) | |
| get_parent_context_ids ($includeself=false) | |
| get_parent_context () | |
| get_course_context ($strict=true) | |
| reload_if_dirty () | |
| mark_dirty () | |
Static Public Member Functions | |
| static | instance_by_id ($id, $strictness=MUST_EXIST) |
Protected Member Functions | |
| __construct (stdClass $record) | |
Static Protected Member Functions | |
| static | reset_caches () |
| static | cache_add (context $context) |
| static | cache_remove (context $context) |
| static | cache_get ($contextlevel, $instance) |
| static | cache_get_by_id ($id) |
| static | preload_from_record (stdClass $rec) |
| static | create_instance_from_record (stdClass $record) |
| static | merge_context_temp_table () |
| static | insert_context_record ($contextlevel, $instanceid, $parentpath) |
| static | get_cleanup_sql () |
| static | build_paths ($force) |
| static | create_level_instances () |
Protected Attributes | |
| $_id | |
| $_contextlevel | |
| $_instanceid | |
| $_path | |
| $_depth | |
Static Protected Attributes | |
| static | $cache_count = 0 |
| static | $cache_preloaded = array() |
| static | $systemcontext = null |
Definition at line 4490 of file accesslib.php.
| __construct | ( | stdClass $ | record | ) | [protected] |
Constructor is protected so that devs are forced to use context_xxx::instance() or context::instance_by_id().
| stdClass | $record |
Reimplemented in context_block, context_module, context_course, context_coursecat, context_user, and context_system.
Definition at line 4706 of file accesslib.php.
| __get | ( | $ | name | ) |
Magic method getter, redirects to read only values.
| string | $name |
Definition at line 4658 of file accesslib.php.

| __isset | ( | $ | name | ) |
Full support for isset on our magic read only properties.
| $name |
Definition at line 4677 of file accesslib.php.
| __set | ( | $ | name, |
| $ | value | ||
| ) |
Magic setter method, we do not want anybody to modify properties from the outside
| string | $name | |
| mixed |
Definition at line 4649 of file accesslib.php.

| __unset | ( | $ | name | ) |
ALl properties are read only, sorry.
| string | $name |
Definition at line 4694 of file accesslib.php.

| static build_paths | ( | $ | force | ) | [static, protected] |
Rebuild context paths and depths at context level.
| $force |
Reimplemented in context_block, context_module, context_course, context_coursecat, context_user, and context_system.
Definition at line 5130 of file accesslib.php.

Adds a context to the cache. If the cache is full, discards a batch of older entries.
| context | $context | New context to add |
Definition at line 4537 of file accesslib.php.

| static cache_get | ( | $ | contextlevel, |
| $ | instance | ||
| ) | [static, protected] |
Gets a context from the cache.
| int | $contextlevel | Context level |
| int | $instance | Instance ID |
Definition at line 4596 of file accesslib.php.

| static cache_get_by_id | ( | $ | id | ) | [static, protected] |
Gets a context from the cache based on its id.
| int | $id | Context ID |
Definition at line 4610 of file accesslib.php.

| static cache_remove | ( | context $ | context | ) | [static, protected] |
Removes a context from the cache.
| context | $context | Context object to remove |
Definition at line 4573 of file accesslib.php.

| static create_instance_from_record | ( | stdClass $ | record | ) | [static, protected] |
This function is also used to work around 'protected' keyword problems in context_helper.
| stdClass | $record |
Definition at line 4720 of file accesslib.php.


| static create_level_instances | ( | ) | [static, protected] |
Create missing context instances at given level
Reimplemented in context_block, context_module, context_course, context_coursecat, context_user, and context_system.
Definition at line 5140 of file accesslib.php.

| delete | ( | ) |
Delete the context content and the context record itself
Definition at line 4927 of file accesslib.php.


| delete_content | ( | ) |
Delete all data linked to content, do not delete the context record itself
Definition at line 4894 of file accesslib.php.


| get_capabilities | ( | ) | [abstract] |
Returns array of relevant context capability records.
Reimplemented in context_block, context_module, context_course, context_coursecat, context_user, context_system, and context_helper.

Recursive function which, given a context, find all its children context ids.
For course category contexts it will return immediate children and all subcategory contexts. It will NOT recurse into courses or subcategories categories. If you want to do that, call it on the returned courses/categories.
When called for a course context, it will return the modules and blocks displayed in the course page and blocks displayed on the module pages.
If called on a user/course/module context it _will_ populate the cache with the appropriate contexts ;-)
Reimplemented in context_block, context_coursecat, and context_system.
Definition at line 5022 of file accesslib.php.


| static get_cleanup_sql | ( | ) | [static, protected] |
Returns sql necessary for purging of stale context instances.
Reimplemented in context_block, context_module, context_course, context_coursecat, context_user, and context_system.
Definition at line 5119 of file accesslib.php.

| get_context_name | ( | $ | withprefix = true, |
| $ | short = false |
||
| ) |
Returns human readable context identifier.
| boolean | $withprefix | whether to prefix the name of the context with the type of context, e.g. User, Course, Forum, etc. |
| boolean | $short | whether to use the short name of the thing. Only applies to course contexts |
Reimplemented in context_block, context_module, context_course, context_coursecat, context_user, and context_system.
Definition at line 4988 of file accesslib.php.

| get_course_context | ( | $ | strict = true | ) |
Is this context part of any course? If yes return course context.
| bool | $strict | true means throw exception if not found, false means return false if not found |
Reimplemented in context_block, context_module, and context_course.
Definition at line 5105 of file accesslib.php.

Returns parent context
Definition at line 5086 of file accesslib.php.


| get_parent_context_ids | ( | $ | includeself = false | ) |
Returns parent contexts of this context in reversed order, i.e. parent first, then grand parent, etc.
| bool | $includeself | tre means include self too |
Definition at line 5067 of file accesslib.php.

| get_parent_contexts | ( | $ | includeself = false | ) |
Returns parent contexts of this context in reversed order, i.e. parent first, then grand parent, etc.
| bool | $includeself | tre means include self too |
Definition at line 5046 of file accesslib.php.


| get_url | ( | ) | [abstract] |
Returns the most relevant URL for this context.
Reimplemented in context_block, context_module, context_course, context_coursecat, context_user, context_system, and context_helper.

| static insert_context_record | ( | $ | contextlevel, |
| $ | instanceid, | ||
| $ | parentpath | ||
| ) | [static, protected] |
Utility method for context creation
| int | $contextlevel | |
| int | $instanceid | |
| string | $parentpath |
Definition at line 4958 of file accesslib.php.

| static instance_by_id | ( | $ | id, |
| $ | strictness = MUST_EXIST |
||
| ) | [static] |
Get a context instance as an object, from a given context id.
| int | $id | context id |
| int | $strictness | IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; MUST_EXIST means throw exception if no record found |
Definition at line 4791 of file accesslib.php.


| mark_dirty | ( | ) |
Mark a context as dirty (with timestamp) so as to force reloading of the context.
Definition at line 5181 of file accesslib.php.


| static merge_context_temp_table | ( | ) | [static, protected] |
Copy prepared new contexts from temp table to context table, we do this in db specific way for perf reasons only.
Definition at line 4738 of file accesslib.php.

| static preload_from_record | ( | stdClass $ | rec | ) | [static, protected] |
Preloads context information from db record and strips the cached info.
| stdClass | $rec |
Reimplemented in context_helper.
Definition at line 4624 of file accesslib.php.

| reload_if_dirty | ( | ) |
Reset all cached permissions and definitions if the necessary.
Definition at line 5148 of file accesslib.php.


| static reset_caches | ( | ) | [static, protected] |
Resets the cache to remove all data.
Reimplemented in context_helper.
Definition at line 4520 of file accesslib.php.

| reset_paths | ( | $ | rebuild = true | ) |
Remove all context path info and optionally rebuild it.
| bool | $rebuild |
Definition at line 4869 of file accesslib.php.

| update_moved | ( | context $ | newparent | ) |
Update context info after moving context in the tree structure.
| context | $newparent |
Definition at line 4824 of file accesslib.php.


$_contextlevel [protected] |
Definition at line 4502 of file accesslib.php.
$_depth [protected] |
Definition at line 4505 of file accesslib.php.
$_id [protected] |
Definition at line 4501 of file accesslib.php.
$_instanceid [protected] |
Definition at line 4503 of file accesslib.php.
$_path [protected] |
Definition at line 4504 of file accesslib.php.
$cache_count = 0 [static, protected] |
Definition at line 4511 of file accesslib.php.
$cache_preloaded = array() [static, protected] |
Definition at line 4513 of file accesslib.php.
$systemcontext = null [static, protected] |
Definition at line 4514 of file accesslib.php.