src/Contao/View/Contao2BackendView/TreePicker.php
private function treeWalkChildCollection(CollectionInterface $childCollection, ModelInterface $model, $level)
    {
        $relationships = $this->getEnvironment()->getDataDefinition()->getModelRelationshipDefinition();

        foreach ($childCollection as $childModel) {
            // Let the child know about it's parent.
            $model->setMeta($model::PARENT_ID, $model->getId());
            $model->setMeta($model::PARENT_PROVIDER_NAME, $model->getProviderName());

            $mySubTables = [];
            foreach ($relationships->getChildConditions($model->getProviderName()) as $condition) {
                $mySubTables[] = $condition->getDestinationName();
            }

            $this->treeWalkModel($childModel, ($level + 1), $mySubTables);
        }
    }
private function treeWalkChildCollection(CollectionInterface $childCollection, ModelInterface $model, $level)
    {
        $relationships = $this->getEnvironment()->getDataDefinition()->getModelRelationshipDefinition();

        foreach ($childCollection as $childModel) {
            // Let the child know about it's parent.
            $model->setMeta($model::PARENT_ID, $model->getId());
            $model->setMeta($model::PARENT_PROVIDER_NAME, $model->getProviderName());

            $mySubTables = [];
            foreach ($relationships->getChildConditions($model->getProviderName()) as $condition) {
                $mySubTables[] = $condition->getDestinationName();
            }

            $this->treeWalkModel($childModel, ($level + 1), $mySubTables);
        }
    }
private function treeWalkChildCollection ( CollectionInterface $ childCollection , ModelInterface $ model , $ level ) { $ relationships = $ this -> getEnvironment ( ) -> getDataDefinition ( ) -> getModelRelationshipDefinition ( ) ; foreach ( $ childCollection as $ childModel ) { // Let the child know about it's parent. $ model -> setMeta ( $ model :: PARENT_ID , $ model -> getId ( ) ) ; $ model -> setMeta ( $ model :: PARENT_PROVIDER_NAME , $ model -> getProviderName ( ) ) ; $ mySubTables = [ ] ; foreach ( $ relationships -> getChildConditions ( $ model -> getProviderName ( ) ) as $ condition ) { $ mySubTables [ ] = $ condition -> getDestinationName ( ) ; } $ this -> treeWalkModel ( $ childModel , ( $ level + 1 ) , $ mySubTables ) ; } }
Walk in the child collection for the tree.

@param CollectionInterface $childCollection The child collection.
@param ModelInterface      $model           The model to render.
@param int                 $level           The current level in the tree hierarchy.

@return void
Walk in the child collection for the tree .