Returns all providers.
public getProviders ( ) : Sulu\Bundle\WebsiteBundle\Sitemap\SitemapProviderInterface[] | ||
return | Sulu\Bundle\WebsiteBundle\Sitemap\SitemapProviderInterface[] |
/** * {@inheritdoc} */ public function dumpPortalInformation(PortalInformation $portalInformation, $scheme) { if (false !== strpos($portalInformation->getUrl(), '{host}')) { if (!$this->defaultHost) { return; } $portalInformation->setUrl(str_replace('{host}', $this->defaultHost, $portalInformation->getUrl())); } $dumpPath = $this->getIndexDumpPath($scheme, $portalInformation->getWebspaceKey(), $portalInformation->getLocale(), $portalInformation->getHost()); $sitemap = $this->sitemapRenderer->renderIndex($portalInformation->getHost(), $scheme); if (!$sitemap) { $aliases = array_keys($this->sitemapProviderPool->getProviders()); $this->dumpFile($dumpPath, $this->sitemapRenderer->renderSitemap(reset($aliases), 1, $portalInformation->getLocale(), $portalInformation->getPortal(), $portalInformation->getHost(), $scheme)); return; } foreach ($this->sitemapProviderPool->getProviders() as $alias => $provider) { $this->dumpProviderSitemap($alias, $portalInformation, $scheme); } $this->dumpFile($dumpPath, $sitemap); }
/** * Returns true if a index exists. * * @return bool */ private function needsIndex() { return 1 < count($this->sitemapProviderPool->getProviders()) || 1 < array_reduce($this->sitemapProviderPool->getIndex(), function ($v1, Sitemap $v2) { return $v1 + $v2->getMaxPage(); }); }