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;
$count = 0;
foreach ($array as $key => $child) {
- $sortorder = $child['object']->sortorder;
+ $sortorder = $child['object']->get_sortorder();
if ($returnnextelement) {
return $sortorder;
}
}
// 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);
}
$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.