/// methods, but instead use the $PAGE->x syntax.
/**
+ * Please do not call this method directly, use the ->state syntax. @see __get().
* @return integer one of the STATE_... constants. You should not normally need
* to use this in your code. It is indended for internal use by this class
* and its friends like print_header, to check that everything is working as
}
/**
- * @return boolean has the header already been printed? Also accessible as
- * $PAGE->headerprinted.
+ * Please do not call this method directly, use the ->headerprinted syntax. @see __get().
+ * @return boolean has the header already been printed?
*/
public function get_headerprinted() {
return $this->_state >= self::STATE_IN_BODY;
}
/**
+ * Please do not call this method directly, use the ->course syntax. @see __get().
* @return object the current course that we are inside - a row from the
* course table. (Also available as $COURSE global.) If we are not inside
- * an actual course, this will be the site course. You can also access this
- * as $PAGE->course.
+ * an actual course, this will be the site course.
*/
public function get_course() {
global $SITE;
}
/**
+ * Please do not call this method directly, use the ->cm syntax. @see __get().
* @return object the course_module that this page belongs to. Will be null
* if this page is not within a module. This is a full cm object, as loaded
* by get_coursemodule_from_id or get_coursemodule_from_instance,
}
/**
- * @return object the course_module that this page belongs to. Will be null
- * if this page is not within a module. This is a full cm object, as loaded
- * by get_coursemodule_from_id or get_coursemodule_from_instance,
- * so the extra modname and name fields are present.
+ * Please do not call this method directly, use the ->activityrecord syntax. @see __get().
+ * @return object the row from the activities own database table (for example
+ * the forum or quiz table) that this page belongs to. Will be null
+ * if this page is not within a module.
*/
public function get_activityrecord() {
if (is_null($this->_module) && !is_null($this->_cm)) {
}
/**
- * @return object the course_module that this page belongs to. Will be null
- * if this page is not within a module. This is a full cm object, as loaded
- * by get_coursemodule_from_id or get_coursemodule_from_instance,
- * so the extra modname and name fields are present.
+ * Please do not call this method directly, use the ->activityname syntax. @see __get().
+ * @return string|null the The type of activity we are in, for example 'forum' or 'quiz'.
+ * Will be null if this page is not within a module.
*/
public function get_activityname() {
if (is_null($this->_cm)) {
}
/**
+ * Please do not call this method directly, use the ->category syntax. @see __get().
* @return mixed the category that the page course belongs to. If there isn't one
* (that is, if this is the front page course) returns null.
*/
}
/**
+ * Please do not call this method directly, use the ->categories syntax. @see __get().
* @return array an array of all the categories the page course belongs to,
* starting with the immediately containing category, and working out to
* the top-level category. This may be the empty array if we are in the
}
/**
+ * Please do not call this method directly, use the ->context syntax. @see __get().
* @return object the main context to which this page belongs.
*/
public function get_context() {
}
/**
+ * Please do not call this method directly, use the ->pagetype syntax. @see __get().
* @return string e.g. 'my-index' or 'mod-quiz-attempt'. Same as the id attribute on <body>.
*/
public function get_pagetype() {
}
/**
+ * Please do not call this method directly, use the ->subpage syntax. @see __get().
* @return string|null The subpage identifier, if any.
*/
public function get_subpage() {
}
/**
+ * Please do not call this method directly, use the ->bodyclasses syntax. @see __get().
* @return string the class names to put on the body element in the HTML.
*/
public function get_bodyclasses() {
}
/**
- * @return string the class names to put on the body element in the HTML.
+ * Please do not call this method directly, use the ->docspath syntax. @see __get().
+ * @return string the path to the Moodle docs for this page.
*/
public function get_docspath() {
if (is_string($this->_docspath)) {
}
/**
+ * Please do not call this method directly, use the ->url syntax. @see __get().
* @return moodle_url the clean URL required to load the current page. (You
* should normally use this in preference to $ME or $FULLME.)
*/
}
/**
+ * Please do not call this method directly, use the ->blocks syntax. @see __get().
* @return blocks_manager the blocks manager object for this page.
*/
public function get_blocks() {
}
/**
- * PHP overloading magic to make the $PAGE->course syntax work.
+ * PHP overloading magic to make the $PAGE->course syntax work by redirecting
+ * it to the corresponding $PAGE->get_course() method if there is one, and
+ * throwing an exception if not.
*/
public function __get($field) {
$getmethod = 'get_' . $field;