/**
  * @Route("/create/{id}", name="orob2b_cms_page_create", requirements={"id"="\d+"}, defaults={"id"=null})
  * @Template("OroB2BCMSBundle:Page:update.html.twig")
  * @Acl(
  *      id="orob2b_cms_page_create",
  *      type="entity",
  *      class="OroB2BCMSBundle:Page",
  *      permission="CREATE"
  * )
  *
  * @param int|null $id
  * @return array|RedirectResponse
  */
 public function createAction($id)
 {
     $page = new Page();
     if ($id) {
         $parentPage = $this->getDoctrine()->getRepository('OroB2BCMSBundle:Page')->find($id);
         if (!$parentPage) {
             throw new \LogicException(sprintf('Page with identifier %s does not exist', $id));
         }
         $page->setParentPage($parentPage);
     }
     return $this->update($page);
 }