bundle/Controller/Admin/TreeController.php
protected function getCollections(Content $content, $isRoot = false)
    {
        $languages = $this->getConfigResolver()->getParameter('languages');

        $query = new Query([
            'contentId' => $content->content->id,
            'limit' => Query::COUNT_QUERY,
        ]);

        $count = $this->service->getCollections($query);

        return array(
            'id' => $content->content->id,
            'parent' => $isRoot ? '#' : '0',
            'text' => $content->contentType->getName($languages[0]) . ' (' . strval($count->count) . ')',
            'children' => false,
            'a_attr' => array(
                'href' => $this->router->generate('netgen_information_collection.route.admin.collection_list', ['contentId' => $content->content->id]),
                'rel' => $content->content->id,
            ),
            'state' => array(
                'opened' => $isRoot,
            ),
            'data' => array(
                'context_menu' => array(
                    array(
                        'name' => 'export',
                        'url' => $this->router->generate('netgen_information_collection.route.admin.export', ['contentId' => $content->content->id]),
                        'text' => $this->translator->trans('netgen_information_collection_admin_export_export', [], 'netgen_information_collection_admin'),
                    ),
                ),
            ),
        );
    }
protected function getCollections(Content $content, $isRoot = false)
    {
        $languages = $this->getConfigResolver()->getParameter('languages');

        $query = new Query([
            'contentId' => $content->content->id,
            'limit' => Query::COUNT_QUERY,
        ]);

        $count = $this->service->getCollections($query);

        return array(
            'id' => $content->content->id,
            'parent' => $isRoot ? '#' : '0',
            'text' => $content->contentType->getName($languages[0]) . ' (' . strval($count->count) . ')',
            'children' => false,
            'a_attr' => array(
                'href' => $this->router->generate('netgen_information_collection.route.admin.collection_list', ['contentId' => $content->content->id]),
                'rel' => $content->content->id,
            ),
            'state' => array(
                'opened' => $isRoot,
            ),
            'data' => array(
                'context_menu' => array(
                    array(
                        'name' => 'export',
                        'url' => $this->router->generate('netgen_information_collection.route.admin.export', ['contentId' => $content->content->id]),
                        'text' => $this->translator->trans('netgen_information_collection_admin_export_export', [], 'netgen_information_collection_admin'),
                    ),
                ),
            ),
        );
    }
protected function getCollections ( Content $ content , $ isRoot = false ) { $ languages = $ this -> getConfigResolver ( ) -> getParameter ( 'languages' ) ; $ query = new Query ( [ 'contentId' => $ content -> content -> id , 'limit' => Query :: COUNT_QUERY , ] ) ; $ count = $ this -> service -> getCollections ( $ query ) ; return array ( 'id' => $ content -> content -> id , 'parent' => $ isRoot ? '#' : '0' , 'text' => $ content -> contentType -> getName ( $ languages [ 0 ] ) . ' (' . strval ( $ count -> count ) . ')' , 'children' => false , 'a_attr' => array ( 'href' => $ this -> router -> generate ( 'netgen_information_collection.route.admin.collection_list' , [ 'contentId' => $ content -> content -> id ] ) , 'rel' => $ content -> content -> id , ) , 'state' => array ( 'opened' => $ isRoot , ) , 'data' => array ( 'context_menu' => array ( array ( 'name' => 'export' , 'url' => $ this -> router -> generate ( 'netgen_information_collection.route.admin.export' , [ 'contentId' => $ content -> content -> id ] ) , 'text' => $ this -> translator -> trans ( 'netgen_information_collection_admin_export_export' , [ ] , 'netgen_information_collection_admin' ) , ) , ) , ) , ) ; }
Creates tree structure for Content

@param \Netgen\Bundle\InformationCollectionBundle\API\Value\InformationCollection\Content $content
@param bool $isRoot

@return array
Creates tree structure for Content