public function createTree(&$openBranch) { $treeUtils = new TreeUtils(); $treeUtils->openBranch($this->mainTree, $openBranch); $mainDiv = new Ul(); $mainDiv->addStyleClasses(["tree", "f-16"]); $this->treeLevel = 0; $tree = $this->createRootNode(); $tree->childrens = array_merge($tree->childrens, $this->mainTree->childrens); $this->treeProcess($tree, $mainDiv, $openBranch); $arr = $treeUtils->getTreeLeafes($this->mainTree); return $mainDiv; }