public function indexAction()
    {
        $businessEntityHelper = $this->get('victoire_core.helper.business_entity_helper');

        //services
        $em = $this->get('doctrine.orm.entity_manager');

        //the repository
        $repository = $em->getRepository('VictoireBusinessPageBundle:BusinessTemplate');

        $BusinessTemplates = [];

        $businessEntities = $businessEntityHelper->getBusinessEntities();

        foreach ($businessEntities as $businessEntity) {
            $name = $businessEntity->getName();

            //retrieve the pagePatterns
            $pagePatterns = $repository->findPagePatternByBusinessEntity($businessEntity);

            $BusinessTemplates[$name] = $pagePatterns;
        }

        return new JsonResponse([
                'html' => $this->container->get('templating')->render(
                    'VictoireBusinessPageBundle:BusinessEntity:index.html.twig',
                    [
                        'businessEntities'  => $businessEntities,
                        'BusinessTemplates' => $BusinessTemplates,
                    ]
                ),
                'success' => true,
            ]);
    }