Controller/SectionTreeController.php
public function getSectiontreeAction($id, ParamFetcherInterface $paramFetcher) {
        $manager = $this->get('doctrine_phpcr.odm.default_document_manager');

        $parent = $manager->find(null, $id);

        if(! $parent instanceof Section) {
        	$parent = $parent->getSectionConfig();
        }

        $children = $parent->getNextSection();
        $list = array();
        foreach ($children as $section) {
        	$list[] = $section->getSectionConfig();
        }

        $context = $this->getSerializerContext(array('list'));
        $view = View::create($list, 200)->setSerializationContext($context);
        return $this->handleView($view);
    }
public function getSectiontreeAction($id, ParamFetcherInterface $paramFetcher) {
        $manager = $this->get('doctrine_phpcr.odm.default_document_manager');

        $parent = $manager->find(null, $id);

        if(! $parent instanceof Section) {
        	$parent = $parent->getSectionConfig();
        }

        $children = $parent->getNextSection();
        $list = array();
        foreach ($children as $section) {
        	$list[] = $section->getSectionConfig();
        }

        $context = $this->getSerializerContext(array('list'));
        $view = View::create($list, 200)->setSerializationContext($context);
        return $this->handleView($view);
    }
Get list of a Sections records
@param ParamFetcherInterface $paramFetcher

@Route(requirements={"id"=".+"})

@QueryParam(name="group", description="The JMS Serializer group", default="")
@QueryParam(name="depth", description="The depth to use for serialization", default="1")

@return \Symfony\Component\HttpFoundation\Response