MDL-9972 Removed the __destruct() method, which was not needed. Also fixed a few bugs that caused notices in PHP5.
This commit is contained in:
@@ -416,7 +416,7 @@ class grade_tree {
|
||||
foreach ($elements as $key => $element) {
|
||||
$this->first_sortorder++;
|
||||
$new_sortorder = $this->first_sortorder;
|
||||
$old_sortorder = $element['object']->sortorder;
|
||||
$old_sortorder = $element['object']->get_sortorder();
|
||||
|
||||
// Assign new sortorder
|
||||
$element['object']->sortorder = $new_sortorder;
|
||||
@@ -501,7 +501,7 @@ class grade_tree {
|
||||
$count = 0;
|
||||
|
||||
foreach ($array as $key => $child) {
|
||||
$sortorder = $child['object']->sortorder;
|
||||
$sortorder = $child['object']->get_sortorder();
|
||||
if ($returnnextelement) {
|
||||
return $sortorder;
|
||||
}
|
||||
@@ -547,7 +547,7 @@ class grade_tree {
|
||||
}
|
||||
|
||||
// Look at the current key of the fillers array. It is a sortorder.
|
||||
if (key($this->fillers) < $object->sortorder || empty($object)) {
|
||||
if (empty($object) || key($this->fillers) < $object->sortorder) {
|
||||
$sortorder = key($this->fillers);
|
||||
$filler_object = current($this->fillers);
|
||||
|
||||
|
||||
@@ -363,17 +363,6 @@ class gradelib_test extends UnitTestCase {
|
||||
}
|
||||
$CFG->prefix = $CFG->old_prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* In PHP5, this is called to drop the test tables after all the tests have been performed.
|
||||
* Until we move to PHP5, I know no easy way to accomplish this.
|
||||
*/
|
||||
function __destruct() {
|
||||
foreach ($this->tables as $table) {
|
||||
$xmldbtable = new XMLDBTable($table);
|
||||
drop_table($xmldbtable, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load scale data into the database, and adds the corresponding objects to this class' variable.
|
||||
|
||||
Reference in New Issue
Block a user