Sulu\Bundle\WebsiteBundle\Sitemap\SitemapProviderPoolInterface::hasProvider PHP Method

hasProvider() public method

Indicates that the provider with alias exists.
public hasProvider ( string $alias ) : boolean
$alias string
return boolean
    public function hasProvider($alias);

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function renderSitemap($alias, $page, $locale, Portal $portal, $host, $scheme)
 {
     if (!$this->sitemapProviderPool->hasProvider($alias)) {
         return;
     }
     $provider = $this->sitemapProviderPool->getProvider($alias);
     if ($provider->getMaxPage() < $page) {
         return;
     }
     $entries = $provider->build($page, $portal->getKey(), $locale);
     return $this->render('SuluWebsiteBundle:Sitemap:sitemap.xml.twig', ['webspaceKey' => $portal->getWebspace()->getKey(), 'locale' => $locale, 'defaultLocale' => $portal->getXDefaultLocalization()->getLocale(), 'domain' => $host, 'scheme' => $scheme, 'entries' => $entries]);
 }