bundle/Controller/Admin/TreeController.php
public function getChildrenAction($isRoot = false)
    {
        $this->denyAccessUnlessGranted('ez:infocollector:read');

        $result = array();

        if ((bool) $isRoot) {
            $result[] = $this->getRootTreeData();
        } else {

            $query = new Query([
                'limit' => $this->getConfigResolver()->getParameter('admin.tree_limit', 'netgen_information_collection'),
            ]);

            $objects = $this->service->getObjectsWithCollections($query);
            foreach ($objects->contents as $content) {
                $result[] = $this->getCollections($content, $isRoot);
            }
        }

        return (new JsonResponse())->setData($result);
    }
public function getChildrenAction($isRoot = false)
    {
        $this->denyAccessUnlessGranted('ez:infocollector:read');

        $result = array();

        if ((bool) $isRoot) {
            $result[] = $this->getRootTreeData();
        } else {

            $query = new Query([
                'limit' => $this->getConfigResolver()->getParameter('admin.tree_limit', 'netgen_information_collection'),
            ]);

            $objects = $this->service->getObjectsWithCollections($query);
            foreach ($objects->contents as $content) {
                $result[] = $this->getCollections($content, $isRoot);
            }
        }

        return (new JsonResponse())->setData($result);
    }
public function getChildrenAction ( $ isRoot = false ) { $ this -> denyAccessUnlessGranted ( 'ez:infocollector:read' ) ; $ result = array ( ) ; if ( ( bool ) $ isRoot ) { $ result [ ] = $ this -> getRootTreeData ( ) ; } else { $ query = new Query ( [ 'limit' => $ this -> getConfigResolver ( ) -> getParameter ( 'admin.tree_limit' , 'netgen_information_collection' ) , ] ) ; $ objects = $ this -> service -> getObjectsWithCollections ( $ query ) ; foreach ( $ objects -> contents as $ content ) { $ result [ ] = $ this -> getCollections ( $ content , $ isRoot ) ; } } return ( new JsonResponse ( ) ) -> setData ( $ result ) ; }
Get contents with collections

@param bool $isRoot

@return \Symfony\Component\HttpFoundation\JsonResponse
Get contents with collections