Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]
Contains class core_course_list_element
Copyright: | 2018 Marina Glancy |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 481 lines (17 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
core_course_list_element:: (24 methods):
__construct()
has_summary()
has_course_contacts()
get_course_contacts()
get_custom_fields()
has_custom_fields()
has_course_overviewfiles()
get_course_overviewfiles()
__isset()
__get()
__unset()
__set()
getIterator()
get_formatted_name()
get_formatted_fullname()
get_formatted_shortname()
can_access()
can_edit()
can_change_visibility()
get_context()
can_review_enrolments()
can_delete()
can_backup()
can_restore()
Class: core_course_list_element - X-Ref
Class to store information about one course in a list of courses__construct(stdClass $record) X-Ref |
Creates an instance of the class from record param: stdClass $record except fields from course table it may contain |
has_summary() X-Ref |
Indicates if the course has non-empty summary field return: bool |
has_course_contacts() X-Ref |
Indicates if the course have course contacts to display return: bool |
get_course_contacts() X-Ref |
Returns list of course contacts (usually teachers) to display in course link Roles to display are set up in $CFG->coursecontact The result is the list of users where user id is the key and the value is an array with elements: - 'user' - object containing basic user information - 'role' - object containing basic role information (id, name, shortname, coursealias) - 'rolename' => role_get_name($role, $context, ROLENAME_ALIAS) - 'username' => fullname($user, $canviewfullnames) return: array |
get_custom_fields() X-Ref |
Returns custom fields data for this course return: \core_customfield\data_controller[] |
has_custom_fields() X-Ref |
Does this course have custom fields return: bool |
has_course_overviewfiles() X-Ref |
Checks if course has any associated overview files return: bool |
get_course_overviewfiles() X-Ref |
Returns all course overview files return: array array of stored_file objects |
__isset($name) X-Ref |
Magic method to check if property is set param: string $name return: bool |
__get($name) X-Ref |
Magic method to get a course property Returns any field from table course (retrieves it from DB if it was not retrieved before) param: string $name return: mixed |
__unset($name) X-Ref |
All properties are read only, sorry. param: string $name |
__set($name, $value) X-Ref |
Magic setter method, we do not want anybody to modify properties from the outside param: string $name param: mixed $value |
getIterator() X-Ref |
Create an iterator because magic vars can't be seen by 'foreach'. Exclude context fields Implementing method from interface IteratorAggregate return: ArrayIterator |
get_formatted_name() X-Ref |
Returns the name of this course as it should be displayed within a list. return: string |
get_formatted_fullname() X-Ref |
Returns the formatted fullname for this course. return: string |
get_formatted_shortname() X-Ref |
Returns the formatted shortname for this course. return: string |
can_access() X-Ref |
Returns true if the current user can access this course. return: bool |
can_edit() X-Ref |
Returns true if the user can edit this courses settings. Note: this function does not check that the current user can access the course. To do that please call require_login with the course, or if not possible call {@link core_course_list_element::can_access()} return: bool |
can_change_visibility() X-Ref |
Returns true if the user can change the visibility of this course. Note: this function does not check that the current user can access the course. To do that please call require_login with the course, or if not possible call {@link core_course_list_element::can_access()} return: bool |
get_context() X-Ref |
Returns the context for this course. return: context_course |
can_review_enrolments() X-Ref |
Returns true if the current user can review enrolments for this course. Note: this function does not check that the current user can access the course. To do that please call require_login with the course, or if not possible call {@link core_course_list_element::can_access()} return: bool |
can_delete() X-Ref |
Returns true if the current user can delete this course. Note: this function does not check that the current user can access the course. To do that please call require_login with the course, or if not possible call {@link core_course_list_element::can_access()} return: bool |
can_backup() X-Ref |
Returns true if the current user can backup this course. Note: this function does not check that the current user can access the course. To do that please call require_login with the course, or if not possible call {@link core_course_list_element::can_access()} return: bool |
can_restore() X-Ref |
Returns true if the current user can restore this course. Note: this function does not check that the current user can access the course. To do that please call require_login with the course, or if not possible call {@link core_course_list_element::can_access()} return: bool |