public function add_children(& $node, $parentidnumber) {
        foreach ($this->flat as $competency) {
            if ($competency->parentidnumber == $parentidnumber) {
                $this->progress->increment_progress();
                $node->children[] = $competency;
                $this->add_children($competency, $competency->idnumber);
            }
        }
    }
public function add_children(& $node, $parentidnumber) {
        foreach ($this->flat as $competency) {
            if ($competency->parentidnumber == $parentidnumber) {
                $this->progress->increment_progress();
                $node->children[] = $competency;
                $this->add_children($competency, $competency->idnumber);
            }
        }
    }
public function add_children ( & $ node , $ parentidnumber ) { foreach ( $ this -> flat as $ competency ) { if ( $ competency -> parentidnumber == $ parentidnumber ) { $ this -> progress -> increment_progress ( ) ; $ node -> children [ ] = $ competency ; $ this -> add_children ( $ competency , $ competency -> idnumber ) ; } } }
Add a competency to the parent with the specified idnumber.

@param competency $node (pass by reference)
@param string $parentidnumber Add this competency to the parent with this idnumber.
Add a competency to the parent with the specified idnumber .