Controller/EntitiesController.php
public function getEntityAction(ParamFetcherInterface $paramFetcher, $id) {
    	$entityName = $paramFetcher->get("entity");
    	$modelLoader = $this->get("togu.generator.model.config");
    	if(! $modelLoader->hasModel($entityName)) {
    		throw new NotFoundHttpException("Entity $entityName is not defined");
    	}
        $manager = $this->get("doctrine_phpcr.odm.default_document_manager");
        $entity = $manager->getRepository($modelLoader->getFullClassName($entityName))->find($id);
        $view = View::create(array(
        	"success" => $entity !== null,
        	"total" => $entity !== null ? 1 : 0,
        	"records" => array($entity)
        ), 200)->setSerializationContext($this->getSerializerContext(array("get")));;
        return $this->handleView($view);
    }
public function getEntityAction(ParamFetcherInterface $paramFetcher, $id) {
    	$entityName = $paramFetcher->get("entity");
    	$modelLoader = $this->get("togu.generator.model.config");
    	if(! $modelLoader->hasModel($entityName)) {
    		throw new NotFoundHttpException("Entity $entityName is not defined");
    	}
        $manager = $this->get("doctrine_phpcr.odm.default_document_manager");
        $entity = $manager->getRepository($modelLoader->getFullClassName($entityName))->find($id);
        $view = View::create(array(
        	"success" => $entity !== null,
        	"total" => $entity !== null ? 1 : 0,
        	"records" => array($entity)
        ), 200)->setSerializationContext($this->getSerializerContext(array("get")));;
        return $this->handleView($view);
    }
Get detail of a record
@param              $id

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

@QueryParam(name="entity", description="EntityName", default="")
@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