示例#1
0
 /**
  * Create node translation seo metadata.
  *
  * @param NodeTranslationInterface $translation
  *
  * @return SeoMetadataInterface
  */
 public function create(NodeTranslationInterface $translation)
 {
     $seoMetadata = $this->seoMetadataManager->create();
     $seoMetadata->setLang($translation->getLang());
     $seoMetadata->setTitle($translation->getTitle());
     $this->seoMetadataManager->add($seoMetadata);
     return $seoMetadata;
 }
示例#2
0
 /**
  * Create node translation route.
  *
  * @param NodeTranslationInterface $translation
  *
  * @return RouteInterface
  */
 public function create(NodeTranslationInterface $translation)
 {
     $locale = $translation->getLang();
     $node = $translation->getNode();
     $route = $this->routeManager->create();
     $route->setRoutePattern($this->routerHelper->getRoutePattern($translation->getTitle(), $node, $locale));
     $this->routeGenerator->generateRoute($route, $node, $locale);
     $this->routeManager->add($route);
     return $route;
 }