Bundle/PageBundle/Controller/BasePageController.php
public function showBusinessPageByIdAction(Request $request, $entityId, $type)
    {
        $businessEntityHelper = $this->get('victoire_core.helper.queriable_business_entity_helper');
        $businessEntity = $businessEntityHelper->findById($type);
        $entity = $businessEntityHelper->getByBusinessEntityAndId($businessEntity, $entityId);

        $refClass = new \ReflectionClass($entity);

        $templateId = $this->get('victoire_business_page.business_page_helper')
            ->guessBestPatternIdForEntity($refClass, $entityId, $this->container->get('doctrine.orm.entity_manager'));

        $page = $this->get('victoire_page.page_helper')->findPageByParameters([
            'viewId'   => $templateId,
            'entityId' => $entityId,
            'locale'   => $request->getLocale(),
        ]);

        return $this->redirect(
            $this->generateUrl(
                'victoire_core_page_show',
                [
                    'url' => $page->getReference()->getUrl(),
                ]
            )
        );
    }
public function showBusinessPageByIdAction(Request $request, $entityId, $type)
    {
        $businessEntityHelper = $this->get('victoire_core.helper.queriable_business_entity_helper');
        $businessEntity = $businessEntityHelper->findById($type);
        $entity = $businessEntityHelper->getByBusinessEntityAndId($businessEntity, $entityId);

        $refClass = new \ReflectionClass($entity);

        $templateId = $this->get('victoire_business_page.business_page_helper')
            ->guessBestPatternIdForEntity($refClass, $entityId, $this->container->get('doctrine.orm.entity_manager'));

        $page = $this->get('victoire_page.page_helper')->findPageByParameters([
            'viewId'   => $templateId,
            'entityId' => $entityId,
            'locale'   => $request->getLocale(),
        ]);

        return $this->redirect(
            $this->generateUrl(
                'victoire_core_page_show',
                [
                    'url' => $page->getReference()->getUrl(),
                ]
            )
        );
    }
public function showBusinessPageByIdAction ( Request $ request , $ entityId , $ type ) { $ businessEntityHelper = $ this -> get ( 'victoire_core.helper.queriable_business_entity_helper' ) ; $ businessEntity = $ businessEntityHelper -> findById ( $ type ) ; $ entity = $ businessEntityHelper -> getByBusinessEntityAndId ( $ businessEntity , $ entityId ) ; $ refClass = new \ ReflectionClass ( $ entity ) ; $ templateId = $ this -> get ( 'victoire_business_page.business_page_helper' ) -> guessBestPatternIdForEntity ( $ refClass , $ entityId , $ this -> container -> get ( 'doctrine.orm.entity_manager' ) ) ; $ page = $ this -> get ( 'victoire_page.page_helper' ) -> findPageByParameters ( [ 'viewId' => $ templateId , 'entityId' => $ entityId , 'locale' => $ request -> getLocale ( ) , ] ) ; return $ this -> redirect ( $ this -> generateUrl ( 'victoire_core_page_show' , [ 'url' => $ page -> getReference ( ) -> getUrl ( ) , ] ) ) ; }
Find BusinessPage url for an Entity id and type and redirect to showAction.
Route for this action is defined in RouteLoader.

@param Request $request
@param $entityId
@param $type

@return RedirectResponse
Find BusinessPage url for an Entity id and type and redirect to showAction . Route for this action is defined in RouteLoader .