Bundle/SitemapBundle/Controller/SitemapController.php
public function changePriorityAction(Request $request, BasePage $page)
    {
        $em = $this->get('doctrine.orm.entity_manager');

        $pageSeo = $page->getSeo() ?: new PageSeo();
        $pageSeo->setCurrentLocale($request->getLocale());

        $form = $this->createSitemapPriorityType($page, $pageSeo);
        $form->handleRequest($request);
        $params = [
            'success' => $form->isValid(),
        ];

        if ($form->isValid()) {
            $page->setSeo($pageSeo);
            $em->persist($pageSeo);
            $em->flush();
        }

        return new JsonResponse($params);
    }
public function changePriorityAction(Request $request, BasePage $page)
    {
        $em = $this->get('doctrine.orm.entity_manager');

        $pageSeo = $page->getSeo() ?: new PageSeo();
        $pageSeo->setCurrentLocale($request->getLocale());

        $form = $this->createSitemapPriorityType($page, $pageSeo);
        $form->handleRequest($request);
        $params = [
            'success' => $form->isValid(),
        ];

        if ($form->isValid()) {
            $page->setSeo($pageSeo);
            $em->persist($pageSeo);
            $em->flush();
        }

        return new JsonResponse($params);
    }
public function changePriorityAction ( Request $ request , BasePage $ page ) { $ em = $ this -> get ( 'doctrine.orm.entity_manager' ) ; $ pageSeo = $ page -> getSeo ( ) ? : new PageSeo ( ) ; $ pageSeo -> setCurrentLocale ( $ request -> getLocale ( ) ) ; $ form = $ this -> createSitemapPriorityType ( $ page , $ pageSeo ) ; $ form -> handleRequest ( $ request ) ; $ params = [ 'success' => $ form -> isValid ( ) , ] ; if ( $ form -> isValid ( ) ) { $ page -> setSeo ( $ pageSeo ) ; $ em -> persist ( $ pageSeo ) ; $ em -> flush ( ) ; } return new JsonResponse ( $ params ) ; }
Change the sitemap priority for the given page.

@Route("/changePriority/{id}", name="victoire_sitemap_changePriority", options={"expose"=true})

@return JsonResponse
Change the sitemap priority for the given page .