Esempio n. 1
0
 /**
  * {@inheritdoc}
  *
  * @param KeywordsReadInterface $content
  */
 public function updateMetadata($content, SeoMetadataInterface $seoMetadata)
 {
     $keywords = $content->getSeoKeywords();
     if (is_array($keywords)) {
         $keywords = implode(', ', $keywords);
     }
     $seoMetadata->setMetaKeywords($keywords);
 }
 /**
  * {@inheritdoc}
  *
  * @param OriginalRouteReadInterface $content
  */
 public function updateMetadata($content, SeoMetadataInterface $seoMetadata)
 {
     $route = $content->getSeoOriginalRoute();
     try {
         $seoMetadata->setOriginalUrl($this->urlGenerator->generate($route));
     } catch (RouteNotFoundException $e) {
         throw new ExtractorStrategyException('Unable to create a url.', 0, $e);
     }
 }
Esempio n. 3
0
 /**
  * {@inheritDoc}
  *
  * @param TitleReadInterface $content
  */
 public function updateMetadata($content, SeoMetadataInterface $seoMetadata)
 {
     $seoMetadata->setTitle($content->getSeoTitle());
 }
Esempio n. 4
0
 /**
  * Copy the metadata object to sanitize it and remove doctrine traces.
  *
  * @param SeoMetadataInterface $contentSeoMetadata
  *
  * @return SeoMetadata
  */
 private function copyMetadata(SeoMetadataInterface $contentSeoMetadata)
 {
     $metadata = new SeoMetadata();
     return $metadata->setTitle($contentSeoMetadata->getTitle())->setMetaKeywords($contentSeoMetadata->getMetaKeywords())->setMetaDescription($contentSeoMetadata->getMetaDescription())->setOriginalUrl($contentSeoMetadata->getOriginalUrl())->setExtraProperties($contentSeoMetadata->getExtraProperties() ?: array())->setExtraNames($contentSeoMetadata->getExtraNames() ?: array())->setExtraHttp($contentSeoMetadata->getExtraHttp() ?: array());
 }
Esempio n. 5
0
 /**
  * {@inheritDoc}
  *
  * @param DescriptionReadInterface $content
  */
 public function updateMetadata($content, SeoMetadataInterface $seoMetadata)
 {
     $seoMetadata->setMetaDescription($content->getSeoDescription());
 }
 /**
  * {@inheritdoc}
  */
 public function updateMetadata($content, SeoMetadataInterface $seoMetadata)
 {
     $seoMetadata->setOriginalUrl($content->getSeoOriginalUrl());
 }