Controller/EntitiesController.php
public function deleteEntitiesAction(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);
        $manager->remove($entity);
        $manager->flush();
        return $this->handleView(View::create(null, 204));
    }
public function deleteEntitiesAction(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);
        $manager->remove($entity);
        $manager->flush();
        return $this->handleView(View::create(null, 204));
    }
Delete an existing record
@param $id

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

@QueryParam(name="entity", description="EntityName", default="")
@return \Symfony\Component\HttpFoundation\Response