Generates data for root of the tree.

@return array
356163
protected function getRootTreeData()
    {
        return [
            'id' => '0',
            'parent' => '#',
            'text' => $this->treeLabels['top_level_tags'],
            'children' => true,
            'state' => [
                'opened' => true,
            ],
            'a_attr' => [
                'href' => $this->treeLinks['top_level_tags'],
                'rel' => '0',
            ],
            'data' => [
                'context_menu' => [
                    [
                        'name' => 'add_child',
                        'url' => str_replace(':parentId', 0, $this->treeLinks['add_child']),
                        'text' => $this->treeLabels['add_child'],
                    ],
                ],
            ],
        ];
    }
424416
public function getTreePathRows()
    {
        $parts = array($this);
        $upperRow = $this;
        while (!is_null($upperRow = $upperRow->getParentNode())) {
            $parts[] = $upperRow;
        }
        return array_reverse($parts);
    }
557094
public function getRootNodes()
	{
		$filter = new DoctrineSearchCondition();
		$filter->levelEqualsTo(0);
		
		$order = new DoctrineSelectOrder();
		$order->byLeftAscending();
		
		$rootNodes = $this->nestedSetRepository->search($filter, $order);
		
		return $rootNodes;
	}
323035
public function nextEndData()
    {
        $stateData = $this->state();
        if ($stateData === null) {
            return array(-1, null); // init/root state
        }
        $termPattern = $stateData[2];
        assert($termPattern !== null);
        $data = $this->getNext(array($termPattern));
        return $data;
    }
1266387
public function getAllRoots()
    {
        $roots = [];
        foreach ($this->filesystems->keys() as $ident) {
            $disk = $this->getNamedRoot($ident);
            if ($disk !== null) {
                $roots[$ident] = $disk;
            }
        }

        return $roots;
    }
393063
public function rootNodes()
    {
        $query = $this->model->newQuery()->whereNull($this->parentIdKey);

        $this->callBeforeListeners('rootNodes', [$query]);

        $nodes = $query->get()->all();

        $this->callAfterListeners('rootNodes', [$nodes]);

        return $nodes;
    }
1295277
public function getRoot() {

		$parentTable = CoreTables::getTableName( CoreTables::TABLE_CATEGORY );

		return $this->hasOne( Category::class, [ 'id' => 'rootId' ] )->from( "$parentTable as root" );
	}
316318
public function getRoot()
    {
        if ($this->root === null) {
            $this->root = $this->menuFactory->createItem($this->getName());
        }
        return $this->root;
    }
160125
public Map getRootData() {
		for (Scope cur=this; true; cur=cur.parent) {
			if (cur.parent == null) {
				return cur.data;
			}
		}
	}
926250
private function _getRoots()
    {
        $directories = [];

        if (is_string($this->module->root)) {
            $root = Yii::getAlias($this->module->root);
            if ($this->module->scanRootParentDirectory) {
                $root = dirname($root);
            }

            $directories[] = $root;
        } elseif (is_array($this->module->root)) {
            foreach ($this->module->root as $root) {
                $directories[] = Yii::getAlias($root);
            }
        } else {
            throw new InvalidConfigException('Invalid `root` option value!');
        }

        return $directories;
    }
1042478
public function generateTree()
    {
        $this->options['valid_content_extensions'] = $this->getContentExtensions();

        $this->tree = new Root($this->getParams());
        Builder::build($this->tree, $this->options['ignore']);

        // Apply the language name as Section title
        if ($this->options->isMultilanguage()) {
            foreach ($this->options['languages'] as $key => $node) {
                $this->tree->getEntries()[$key]->setTitle($node);
            }
        }

        // Enhance the tree with processors
        $this->getProcessor()->manipulateTree($this->tree);

        // Sort the tree one last time before it is finalized
        Builder::sortTree($this->tree);

        Builder::finalizeTree($this->tree);
    }
1157102
public function getTreeNodeStates()
    {
        if (!isset($this->nodeStates)) {
            $environment      = $this->getEnvironment();
            $sessionStorage   = $environment->getSessionStorage();
            $this->nodeStates = new TreeNodeStates(
                $sessionStorage->get($this->getToggleId()),
                $this->determineParentsOfValues()
            );

            // Maybe it is not the best location to do this here.
            if ('all' === $environment->getInputProvider()->getParameter('ptg')) {
                // Save in session and reload.
                $sessionStorage->set(
                    $this->getToggleId(),
                    $this->nodeStates->setAllOpen($this->nodeStates->isAllOpen())->getStates()
                );

                $environment->getEventDispatcher()->dispatch(ContaoEvents::CONTROLLER_RELOAD, new ReloadEvent());
            }
        }

        return $this->nodeStates;
    }
350731
public function getReducedTree()
    {
        $parseTree = function (Node $node, Node $target) use ( &$parseTree ) {
            if (substr($target->getPath(),0, strlen($node->getPath())) != $node->getPath()) {
                return array();
            }
            $tree = array();

            foreach ($node->getNodes() as $child) {
                $tree[] = array(
                    'name'          =>  $child->getName(),
                    'path'          =>  $child->getPath(),
                    'hasChildren'   =>  $child->hasNodes(),
                    'children'      =>  $parseTree($child, $target)
                );
            }

            return $tree;
        };

        $treeFactory = function($parent, $node) use ($parseTree) {
            return [ '/' => [
                'name'          =>  '/',
                'path'          =>  '/',
                'hasChildren'   =>  $parent->hasNodes(),
                'children'      =>  $parseTree($parent, $node)
            ]];
        };

        if ($this->getPath() == '/') {
            return $treeFactory($this, $this);
        }

        $parent = $this;
        do {
            $parent = $parent->getParent();
        } while ($parent->getPath() != '/');

        return $treeFactory($parent, $this);
    }
1253804
public function getRootDirectory()
    {
        if(isset($this->rootDirectory) == false) {
            $this->rootDirectory = $this->locateRootDirectory();
        }
        return $this->rootDirectory;
    }
404113
public function getData()
    {
        $data = $this->context->data;
        $result = [
            'version' => 3,
            'file' => $data['file'] ?: '',
            'sourceRoot' => $data['sourceRoot'] ?: '',
            'sources' => $this->sources->getNames(),
            'names' => $this->names->getNames(),
            'mappings' => $this->context->getMappings()->pack(),
        ];
        $contents = $this->sources->getContents();
        if (!empty($contents)) {
            $result['sourcesContent'] = $contents;
        }
        return $result;
    }
1033765
private function getRootIds()
    {
        $root = $this->root;
        $root = \is_array($root) ? $root : ((\is_numeric($root) && $root > 0) ? [$root] : []);
        $root = \array_merge($root, [0]);

        return $root;
    }
182001
public function getRootCategories ()
    {
        return self::where('parent' , 0)
            ->where('slug' , '<>' , config('Categories::category.default_category.slug'))
            ->orderby('id' , 'desc')
            ->where('model_type' , $this->modelType)
            ->get();
    }