/** * Returns true when the children of the item should be hidden from the sitemap * * @param NodeMenuItem $item * * @return bool */ public function isHiddenChildrenFromSitemap(NodeMenuItem $item) { if (is_subclass_of($item->getNode()->getRefEntityName(), 'Kunstmaan\\SitemapBundle\\Helper\\HiddenFromSitemapInterface')) { $page = $item->getPage(); return $page->isChildrenHiddenFromSitemap(); } return false; }
/** * @param string $class * * @return NodeMenuItem|NULL */ public function getParentOfClass($class) { // Check for namespace alias if (strpos($class, ':') !== false) { list($namespaceAlias, $simpleClassName) = explode(':', $class); $class = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; } if ($this->getParent() === null) { return null; } if ($this->parent->getPage() instanceof $class) { return $this->parent; } return $this->parent->getParentOfClass($class); }