/** * Get route name. * * @param NodeInterface $node * @param null|string $locale * * @return string * * @throws RouteException */ public function getRouteName(NodeInterface $node, $locale = null) { if (!$node->getId()) { throw new RouteException('Node id cannot be empty!'); } $name = NodeTranslationInterface::OBJECT_TYPE . '_' . $node->getId(); if (null !== $locale) { $name .= '_' . $locale; } return $name; }
/** * Create seo tab. * * @param NodeInterface $node * * @return Tab */ public function createSeoTab(NodeInterface $node) { return new Tab($this->translator->trans('node.seo', array(), 'TadckaSitemapBundle'), 'node_seo', $this->router->generate('tadcka_sitemap_seo', array('_format' => 'json', 'nodeId' => $node->getId())), 150); }
/** * Create frontend node. * * @param NodeInterface $node * @param string $title * @param bool|array|Node[] $children * @param string $icon * * @return Node */ private function createFrontendNode(NodeInterface $node, $title, $children, $icon) { return new Node($node->getId(), $title, $children, $icon); }
/** * Create json response content. * * @param NodeInterface $node * * @return JsonResponseContent */ public function createJsonContent(NodeInterface $node) { return new JsonResponseContent($node->getId()); }
/** * Render node delete confirm. * * @param NodeInterface $node * * @return string */ private function renderNodeDeleteConfirm(NodeInterface $node) { return $this->responseHelper->render('TadckaSitemapBundle:Node:delete.html.twig', array('node_id' => $node->getId())); }