protected function _sortLevel($id) { if (($elt = $this[$id]) && $elt->needsort) { if (count($this->_parent[strval($elt)]) > 1) { $this->sortList($this->_parent[strval($elt)], $elt); } $this->setAttribute('needsort', $elt, false); } }