protected function getIdsFrom($parent, $depth)
    {
        if ($depth >= $this->Depth) {
            return;
        }
        $ids = array();
        foreach ($parent->Children() as $kid) {
            $ids[] = $kid->ID;
            $childIds = $this->getIdsFrom($kid, $depth + 1);
            if ($childIds) {
                $ids = array_merge($ids, $childIds);
            }
        }
        return $ids;
    }
protected function getIdsFrom($parent, $depth)
    {
        if ($depth >= $this->Depth) {
            return;
        }
        $ids = array();
        foreach ($parent->Children() as $kid) {
            $ids[] = $kid->ID;
            $childIds = $this->getIdsFrom($kid, $depth + 1);
            if ($childIds) {
                $ids = array_merge($ids, $childIds);
            }
        }
        return $ids;
    }
protected function getIdsFrom ( $ parent , $ depth ) { if ( $ depth >= $ this -> Depth ) { return ; } $ ids = array ( ) ; foreach ( $ parent -> Children ( ) as $ kid ) { $ ids [ ] = $ kid -> ID ; $ childIds = $ this -> getIdsFrom ( $ kid , $ depth + 1 ) ; if ( $ childIds ) { $ ids = array_merge ( $ ids , $ childIds ) ; } } return $ ids ; }
Recursively find all the child items that need to be listed

@param DataObject $parent
@param int        $depth
Recursively find all the child items that need to be listed