protected function flatternTree(array $treeIn)
    {
        $treeOut = [];
        foreach ($treeIn as $name => $children) {
            if (count($children) === 0) {
                $treeOut[$name] = [];
            } elseif (count($children) === 1) {
                $name = sprintf('%s-%s', $name, key($children));
                if (count($children[key($children)]) > 0) {
                    $treeOut[$name] = $this->flatternTree($children[key($children)]);
                }else{
                    $treeOut[$name] = [];
                }
            } else {
                $treeOut[$name] = $this->flatternTree($children);
            }

        }
        return $treeOut;
    }