public function collateDescendants($condition, &$collator)
    {
        // apply reasonable hierarchy limits
        $threshold = Config::inst()->get(Hierarchy::class, 'node_threshold_leaf');
        if ($this->numChildren() > $threshold) {
            return false;
        }

        $children = $this->Children();
        if ($children) {
            foreach ($children as $item) {
                if (eval("return $condition;")) {
                    $collator[] = $item;
                }
                /** @var SiteTree $item */
                $item->collateDescendants($condition, $collator);
            }
            return true;
        }
        return false;
    }
public function collateDescendants($condition, &$collator)
    {
        // apply reasonable hierarchy limits
        $threshold = Config::inst()->get(Hierarchy::class, 'node_threshold_leaf');
        if ($this->numChildren() > $threshold) {
            return false;
        }

        $children = $this->Children();
        if ($children) {
            foreach ($children as $item) {
                if (eval("return $condition;")) {
                    $collator[] = $item;
                }
                /** @var SiteTree $item */
                $item->collateDescendants($condition, $collator);
            }
            return true;
        }
        return false;
    }
public function collateDescendants ( $ condition , & $ collator ) { // apply reasonable hierarchy limits $ threshold = Config :: inst ( ) -> get ( Hierarchy :: class , 'node_threshold_leaf' ) ; if ( $ this -> numChildren ( ) > $ threshold ) { return false ; } $ children = $ this -> Children ( ) ; if ( $ children ) { foreach ( $ children as $ item ) { if ( eval ( "return $condition;" ) ) { $ collator [ ] = $ item ; } /** @var SiteTree $item */ $ item -> collateDescendants ( $ condition , $ collator ) ; } return true ; } return false ; }
Collate selected descendants of this page.

{@link $condition} will be evaluated on each descendant, and if it is succeeds, that item will be added to the
$collator array.

@param string $condition The PHP condition to be evaluated. The page will be called $item
@param array  $collator  An array, passed by reference, to collect all of the matching descendants.
@return bool
Collate selected descendants of this page .