src/DlcCategory/Form/BaseForm.php
public function getCategoryInsertionPointValueOptions()
    {
        $trees = $this->getCategoryService()->getAllCategoryTreesAsArray();
        
        $valueOptions = array();
        
        foreach ($trees as $rootId => $tree) {
            $valueOptions[$rootId] = array(
                'label'   => 'Label of category ' . $rootId,
                'options' => array()
            );
            foreach ($tree as $node) {
                $category = $node->getNode();
                
                if ($category->getId() == $rootId) {
                    $valueOptions[$rootId]['label'] = $category->getTitle();
                } //else {
                    $valueOptions[$rootId]['options'][$category->getId()] = str_repeat('-', $node->getLevel()) . $category->getTitle();
                //}
            }
        }
        
        return $valueOptions;
    }
public function getCategoryInsertionPointValueOptions()
    {
        $trees = $this->getCategoryService()->getAllCategoryTreesAsArray();
        
        $valueOptions = array();
        
        foreach ($trees as $rootId => $tree) {
            $valueOptions[$rootId] = array(
                'label'   => 'Label of category ' . $rootId,
                'options' => array()
            );
            foreach ($tree as $node) {
                $category = $node->getNode();
                
                if ($category->getId() == $rootId) {
                    $valueOptions[$rootId]['label'] = $category->getTitle();
                } //else {
                    $valueOptions[$rootId]['options'][$category->getId()] = str_repeat('-', $node->getLevel()) . $category->getTitle();
                //}
            }
        }
        
        return $valueOptions;
    }
public function getCategoryInsertionPointValueOptions ( ) { $ trees = $ this -> getCategoryService ( ) -> getAllCategoryTreesAsArray ( ) ; $ valueOptions = array ( ) ; foreach ( $ trees as $ rootId => $ tree ) { $ valueOptions [ $ rootId ] = array ( 'label' => 'Label of category ' . $ rootId , 'options' => array ( ) ) ; foreach ( $ tree as $ node ) { $ category = $ node -> getNode ( ) ; if ( $ category -> getId ( ) == $ rootId ) { $ valueOptions [ $ rootId ] [ 'label' ] = $ category -> getTitle ( ) ; } //else { $ valueOptions [ $ rootId ] [ 'options' ] [ $ category -> getId ( ) ] = str_repeat ( '-' , $ node -> getLevel ( ) ) . $ category -> getTitle ( ) ; //} } } return $ valueOptions ; }
Returns all categoies for the category position select box

@return array
Returns all categoies for the category position select box