src/ORM/Hierarchy/Hierarchy.php
public function stageChildren($showAll = false, $skipParentIDFilter = false)
    {
        $hideFromHierarchy = $this->owner->config()->hide_from_hierarchy;
        $hideFromCMSTree = $this->owner->config()->hide_from_cms_tree;
        $baseClass = $this->owner->baseClass();
        $baseTable = $this->owner->baseTable();
        $staged = DataObject::get($baseClass)->where(sprintf(
            '%s.%s <> %s.%s',
            Convert::symbol2sql($baseTable),
            Convert::symbol2sql("ParentID"),
            Convert::symbol2sql($baseTable),
            Convert::symbol2sql("ID")
        ));

        if (!$skipParentIDFilter) {
            // There's no filtering by ID if we don't have an ID.
            $staged = $staged->filter('ParentID', (int)$this->owner->ID);
        }

        if ($hideFromHierarchy) {
            $staged = $staged->exclude('ClassName', $hideFromHierarchy);
        }
        if ($hideFromCMSTree && $this->showingCMSTree()) {
            $staged = $staged->exclude('ClassName', $hideFromCMSTree);
        }
        if (!$showAll && DataObject::getSchema()->fieldSpec($this->owner, 'ShowInMenus')) {
            $staged = $staged->filter('ShowInMenus', 1);
        }
        $this->owner->extend("augmentStageChildren", $staged, $showAll);
        return $staged;
    }
public function stageChildren($showAll = false, $skipParentIDFilter = false)
    {
        $hideFromHierarchy = $this->owner->config()->hide_from_hierarchy;
        $hideFromCMSTree = $this->owner->config()->hide_from_cms_tree;
        $baseClass = $this->owner->baseClass();
        $baseTable = $this->owner->baseTable();
        $staged = DataObject::get($baseClass)->where(sprintf(
            '%s.%s <> %s.%s',
            Convert::symbol2sql($baseTable),
            Convert::symbol2sql("ParentID"),
            Convert::symbol2sql($baseTable),
            Convert::symbol2sql("ID")
        ));

        if (!$skipParentIDFilter) {
            // There's no filtering by ID if we don't have an ID.
            $staged = $staged->filter('ParentID', (int)$this->owner->ID);
        }

        if ($hideFromHierarchy) {
            $staged = $staged->exclude('ClassName', $hideFromHierarchy);
        }
        if ($hideFromCMSTree && $this->showingCMSTree()) {
            $staged = $staged->exclude('ClassName', $hideFromCMSTree);
        }
        if (!$showAll && DataObject::getSchema()->fieldSpec($this->owner, 'ShowInMenus')) {
            $staged = $staged->filter('ShowInMenus', 1);
        }
        $this->owner->extend("augmentStageChildren", $staged, $showAll);
        return $staged;
    }
public function stageChildren ( $ showAll = false , $ skipParentIDFilter = false ) { $ hideFromHierarchy = $ this -> owner -> config ( ) -> hide_from_hierarchy ; $ hideFromCMSTree = $ this -> owner -> config ( ) -> hide_from_cms_tree ; $ baseClass = $ this -> owner -> baseClass ( ) ; $ baseTable = $ this -> owner -> baseTable ( ) ; $ staged = DataObject :: get ( $ baseClass ) -> where ( sprintf ( '%s.%s <> %s.%s' , Convert :: symbol2sql ( $ baseTable ) , Convert :: symbol2sql ( "ParentID" ) , Convert :: symbol2sql ( $ baseTable ) , Convert :: symbol2sql ( "ID" ) ) ) ; if ( ! $ skipParentIDFilter ) { // There's no filtering by ID if we don't have an ID. $ staged = $ staged -> filter ( 'ParentID' , ( int ) $ this -> owner -> ID ) ; } if ( $ hideFromHierarchy ) { $ staged = $ staged -> exclude ( 'ClassName' , $ hideFromHierarchy ) ; } if ( $ hideFromCMSTree && $ this -> showingCMSTree ( ) ) { $ staged = $ staged -> exclude ( 'ClassName' , $ hideFromCMSTree ) ; } if ( ! $ showAll && DataObject :: getSchema ( ) -> fieldSpec ( $ this -> owner , 'ShowInMenus' ) ) { $ staged = $ staged -> filter ( 'ShowInMenus' , 1 ) ; } $ this -> owner -> extend ( "augmentStageChildren" , $ staged , $ showAll ) ; return $ staged ; }
Return children in the stage site.

@param bool $showAll Include all of the elements, even those not shown in the menus. Only applicable when
extension is applied to {@link SiteTree}.
@param bool $skipParentIDFilter Set to true to supress the ParentID and ID where statements.
@return DataList
Return children in the stage site .