Merge branch 'wip-MDL-45038-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Dan Poltawski 2014-04-11 12:48:14 +08:00
commit 8a69b046e5
2 changed files with 11 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class info_section extends info {
* @param \section_info $section Section object
*/
public function __construct(\section_info $section) {
parent::__construct(\get_course($section->course), $section->visible,
parent::__construct($section->modinfo->get_course(), $section->visible,
$section->availability);
$this->section = $section;
}

View File

@ -2234,6 +2234,7 @@ class cached_cm_info {
* visible or not available, so this would be true in that case) - obtained dynamically
* @property-read string $sequence Comma-separated list of all modules in the section. Note, this field may not exactly
* match course_sections.sequence if later has references to non-existing modules or not modules of not available module types.
* @property-read course_modinfo $modinfo
*/
class section_info implements IteratorAggregate {
/**
@ -2649,6 +2650,15 @@ class section_info implements IteratorAggregate {
return $this->modinfo->get_course_id();
}
/**
* Modinfo object
*
* @return course_modinfo
*/
private function get_modinfo() {
return $this->modinfo;
}
/**
* Prepares section data for inclusion in sectioncache cache, removing items
* that are set to defaults, and adding availability data if required.