Ejemplo n.º 1
0
 /**
  * Create an instance of the business entity page
  * @param BusinessEntityPagePattern $businessEntityPagePattern The business entity page
  * @param entity                    $entity                    The entity
  * @param string                    $url                       The new url
  *
  * @return \Victoire\Bundle\PageBundle\Entity\Page
  */
 public function createPageInstanceFromBusinessEntityPagePattern(BusinessEntityPagePattern $businessEntityPagePattern, $entity, $url)
 {
     //create a new page
     $newPage = new Page();
     $parentPage = $businessEntityPagePattern->getParent();
     //set the page parameter by the business entity page
     $newPage->setParent($parentPage);
     $newPage->setTemplate($businessEntityPagePattern);
     $newPage->setUrl($url);
     $newPage->setTitle($businessEntityPagePattern->getTitle());
     //update the parameters of the page
     $this->updatePageParametersByEntity($newPage, $entity);
     $businessEntity = $this->businessEntityHelper->findByEntityInstance($entity);
     $entityProxy = new EntityProxy();
     $entityProxy->setEntity($entity, $businessEntity->getName());
     $newPage->setEntityProxy($entityProxy);
     return $newPage;
 }