protected function recursive_get_all_children($classname, array &$result) {
        foreach ($this->children as $child) {
            if (is_a($child, $classname)) {
                $result[] = $child;
            }
            if ($child instanceof tree) {
                $child->recursive_get_all_children($classname, $result);
            }
        }
    }
protected function recursive_get_all_children($classname, array &$result) {
        foreach ($this->children as $child) {
            if (is_a($child, $classname)) {
                $result[] = $child;
            }
            if ($child instanceof tree) {
                $child->recursive_get_all_children($classname, $result);
            }
        }
    }
protected function recursive_get_all_children ( $ classname , array & $ result ) { foreach ( $ this -> children as $ child ) { if ( is_a ( $ child , $ classname ) ) { $ result [ ] = $ child ; } if ( $ child instanceof tree ) { $ child -> recursive_get_all_children ( $ classname , $ result ) ; } } }
Internal function that implements get_all_children efficiently.

@param string $classname Full class name e.g. core_availability\condition
@param array $result Output array of nodes
Internal function that implements get_all_children efficiently .