Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Data about a single section on a course. More...
Public Member Functions | |
__construct ($data, $number, $notused1, $notused2, $modinfo, $notused3) | |
Constructs object from database information plus extra required data. | |
__empty ($name) | |
Magic method to check if the property is empty. | |
__get ($name) | |
Magic method to retrieve the property, this is either basic section property or availability information or additional properties added by course format. | |
__isset ($name) | |
Magic method to check if the property is set. | |
get_available () | |
Finds whether this section is available at the moment for the current user. | |
getIterator () | |
Implementation of IteratorAggregate\getIterator(), allows to cycle through properties and use convert_to_array(). | |
Static Public Member Functions | |
static | convert_for_section_cache ($section) |
Prepares section data for inclusion in sectioncache cache, removing items that are set to defaults, and adding availability data if required. | |
Public Attributes | |
bool | $hasactivites |
True if has activities, otherwise false. | |
Data about a single section on a course.
This contains the fields from the course_sections table, plus additional data when required.
from course_sections table
course-modules (array from course-module id to required completion state for that module) - from cached data in sectioncache field
grade item id to object with ->min, ->max fields) - from cached data in sectioncache field
are met - obtained dynamically
availability which can be displayed to students and/or staff (e.g. 'Available from 3 January 2010') for display on main page - obtained dynamically
has viewhiddensections capability, they can access the section even if it is not visible or not available, so this would be true in that case) - obtained dynamically
match course_sections.sequence if later has references to non-existing modules or not modules of not available module types.
section_info::__construct | ( | $data, | |
$number, | |||
$notused1, | |||
$notused2, | |||
$modinfo, | |||
$notused3 ) |
Constructs object from database information plus extra required data.
object | $data | Array entry from cached sectioncache |
int | $number | Section number (array key) |
int | $notused1 | argument not used (informaion is available in $modinfo) |
int | $notused2 | argument not used (informaion is available in $modinfo) |
course_modinfo | $modinfo | Owner (needed for checking availability) |
int | $notused3 | argument not used (informaion is available in $modinfo) |
section_info::__empty | ( | $name | ) |
Magic method to check if the property is empty.
string | $name | name of the property |
bool |
section_info::__get | ( | $name | ) |
Magic method to retrieve the property, this is either basic section property or availability information or additional properties added by course format.
string | $name | name of the property |
bool |
section_info::__isset | ( | $name | ) |
Magic method to check if the property is set.
string | $name | name of the property |
bool |
|
static |
Prepares section data for inclusion in sectioncache cache, removing items that are set to defaults, and adding availability data if required.
Called by build_section_cache in course_modinfo only; do not use otherwise.
object | $section | Raw section data object |
section_info::get_available | ( | ) |
Finds whether this section is available at the moment for the current user.
The value can be accessed publicly as $sectioninfo->available, but can be called directly if there is a case when it might be called recursively (you can't call property values recursively).
bool |
section_info::getIterator | ( | ) |
Implementation of IteratorAggregate\getIterator(), allows to cycle through properties and use convert_to_array().
ArrayIterator |