Bundle/PageBundle/Helper/PageHelper.php
public function createPageInstanceFromBusinessTemplate(BusinessTemplate $BusinessTemplate, $entity, $url)
    {
        //create a new page
        $newPage = new Page();

        $parentPage = $BusinessTemplate->getParent();

        //set the page parameter by the business entity page
        $newPage->setParent($parentPage);
        $newPage->setTemplate($BusinessTemplate);
        $newPage->setUrl($url);

        $newPage->setTitle($BusinessTemplate->getTitle());

        //update the parameters of the page
        $this->businessPageBuilder->updatePageParametersByEntity($newPage, $entity);

        $businessEntity = $this->businessEntityHelper->findByEntityInstance($entity);
        $entityProxy = new EntityProxy();
        $entityProxy->setEntity($entity, $businessEntity->getName());

        $newPage->setEntityProxy($entityProxy);

        return $newPage;
    }
public function createPageInstanceFromBusinessTemplate(BusinessTemplate $BusinessTemplate, $entity, $url)
    {
        //create a new page
        $newPage = new Page();

        $parentPage = $BusinessTemplate->getParent();

        //set the page parameter by the business entity page
        $newPage->setParent($parentPage);
        $newPage->setTemplate($BusinessTemplate);
        $newPage->setUrl($url);

        $newPage->setTitle($BusinessTemplate->getTitle());

        //update the parameters of the page
        $this->businessPageBuilder->updatePageParametersByEntity($newPage, $entity);

        $businessEntity = $this->businessEntityHelper->findByEntityInstance($entity);
        $entityProxy = new EntityProxy();
        $entityProxy->setEntity($entity, $businessEntity->getName());

        $newPage->setEntityProxy($entityProxy);

        return $newPage;
    }
public function createPageInstanceFromBusinessTemplate ( BusinessTemplate $ BusinessTemplate , $ entity , $ url ) { //create a new page $ newPage = new Page ( ) ; $ parentPage = $ BusinessTemplate -> getParent ( ) ; //set the page parameter by the business entity page $ newPage -> setParent ( $ parentPage ) ; $ newPage -> setTemplate ( $ BusinessTemplate ) ; $ newPage -> setUrl ( $ url ) ; $ newPage -> setTitle ( $ BusinessTemplate -> getTitle ( ) ) ; //update the parameters of the page $ this -> businessPageBuilder -> updatePageParametersByEntity ( $ newPage , $ entity ) ; $ businessEntity = $ this -> businessEntityHelper -> findByEntityInstance ( $ entity ) ; $ entityProxy = new EntityProxy ( ) ; $ entityProxy -> setEntity ( $ entity , $ businessEntity -> getName ( ) ) ; $ newPage -> setEntityProxy ( $ entityProxy ) ; return $ newPage ; }
Create an instance of the business entity page.

@param BusinessTemplate $BusinessTemplate The business entity page
@param entity           $entity           The entity
@param string           $url              The new url

@return \Victoire\Bundle\PageBundle\Entity\Page
Create an instance of the business entity page .