src/Controller/TreeCollector.php
public function getChildrenOf($providerName, $level = 0, $parentModel = null)
    {
        $environment  = $this->getEnvironment();
        $dataProvider = $environment->getDataProvider($providerName);
        $rootConfig   = $this->calculateRootConfig();

        if ($rootCondition = $environment->getDataDefinition()->getModelRelationshipDefinition()->getRootCondition()) {
            $baseFilter = $rootConfig->getFilter();
            $filter     = $rootCondition->getFilterArray();

            if ($baseFilter) {
                $filter = \array_merge($baseFilter, $filter);
            }

            $rootConfig->setFilter($filter);
        }

        if ($parentModel) {
            $this->addParentFilter($rootConfig, $parentModel);
        }

        $rootCollection = $dataProvider->fetchAll($rootConfig);
        $tableTreeData  = $dataProvider->getEmptyCollection();

        if ($rootCollection->length() > 0) {
            $mySubTables = $this->getChildProvidersOf($providerName);

            foreach ($rootCollection as $rootModel) {
                $tableTreeData->push($rootModel);
                $this->treeWalkModel($rootModel, $level, $mySubTables);
            }
        }

        return $tableTreeData;
    }
public function getChildrenOf($providerName, $level = 0, $parentModel = null)
    {
        $environment  = $this->getEnvironment();
        $dataProvider = $environment->getDataProvider($providerName);
        $rootConfig   = $this->calculateRootConfig();

        if ($rootCondition = $environment->getDataDefinition()->getModelRelationshipDefinition()->getRootCondition()) {
            $baseFilter = $rootConfig->getFilter();
            $filter     = $rootCondition->getFilterArray();

            if ($baseFilter) {
                $filter = \array_merge($baseFilter, $filter);
            }

            $rootConfig->setFilter($filter);
        }

        if ($parentModel) {
            $this->addParentFilter($rootConfig, $parentModel);
        }

        $rootCollection = $dataProvider->fetchAll($rootConfig);
        $tableTreeData  = $dataProvider->getEmptyCollection();

        if ($rootCollection->length() > 0) {
            $mySubTables = $this->getChildProvidersOf($providerName);

            foreach ($rootCollection as $rootModel) {
                $tableTreeData->push($rootModel);
                $this->treeWalkModel($rootModel, $level, $mySubTables);
            }
        }

        return $tableTreeData;
    }
public function getChildrenOf ( $ providerName , $ level = 0 , $ parentModel = null ) { $ environment = $ this -> getEnvironment ( ) ; $ dataProvider = $ environment -> getDataProvider ( $ providerName ) ; $ rootConfig = $ this -> calculateRootConfig ( ) ; if ( $ rootCondition = $ environment -> getDataDefinition ( ) -> getModelRelationshipDefinition ( ) -> getRootCondition ( ) ) { $ baseFilter = $ rootConfig -> getFilter ( ) ; $ filter = $ rootCondition -> getFilterArray ( ) ; if ( $ baseFilter ) { $ filter = \ array_merge ( $ baseFilter , $ filter ) ; } $ rootConfig -> setFilter ( $ filter ) ; } if ( $ parentModel ) { $ this -> addParentFilter ( $ rootConfig , $ parentModel ) ; } $ rootCollection = $ dataProvider -> fetchAll ( $ rootConfig ) ; $ tableTreeData = $ dataProvider -> getEmptyCollection ( ) ; if ( $ rootCollection -> length ( ) > 0 ) { $ mySubTables = $ this -> getChildProvidersOf ( $ providerName ) ; foreach ( $ rootCollection as $ rootModel ) { $ tableTreeData -> push ( $ rootModel ) ; $ this -> treeWalkModel ( $ rootModel , $ level , $ mySubTables ) ; } } return $ tableTreeData ; }
Collect all items from real root - without root id.

@param string         $providerName The data provider from which the root element originates from.
@param int            $level        The level in the tree.
@param ModelInterface $parentModel  The optional parent model (mode 4 parent).

@return CollectionInterface
Collect all items from real root - without root id .