/** * {@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); } }
/** * {@inheritDoc} * * @param TitleReadInterface $content */ public function updateMetadata($content, SeoMetadataInterface $seoMetadata) { $seoMetadata->setTitle($content->getSeoTitle()); }
/** * 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()); }
/** * {@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()); }