public function SimpleSitemapViews::getDisplayExtender in Simple XML sitemap 4.x
Same name and namespace in other branches
- 8.3 modules/simple_sitemap_views/src/SimpleSitemapViews.php \Drupal\simple_sitemap_views\SimpleSitemapViews::getDisplayExtender()
Gets the display extender.
Parameters
\Drupal\views\ViewExecutable $view: A view executable instance.
string|null $display_id: The display id. If empty uses the current display.
Return value
\Drupal\simple_sitemap_views\Plugin\views\display_extender\SimpleSitemapDisplayExtender|null The display extender.
1 call to SimpleSitemapViews::getDisplayExtender()
- SimpleSitemapViews::getSitemapSettings in modules/
simple_sitemap_views/ src/ SimpleSitemapViews.php - Gets the sitemap settings for view display.
File
- modules/
simple_sitemap_views/ src/ SimpleSitemapViews.php, line 142
Class
- SimpleSitemapViews
- Class to manage sitemap data for views.
Namespace
Drupal\simple_sitemap_viewsCode
public function getDisplayExtender(ViewExecutable $view, ?string $display_id = NULL) : ?SimpleSitemapDisplayExtender {
// Ensure the display was correctly set.
if (!$view
->setDisplay($display_id)) {
return NULL;
}
$extenders = $view->display_handler
->getExtenders();
$extender = $extenders[self::PLUGIN_ID] ?? NULL;
if ($extender instanceof SimpleSitemapDisplayExtender) {
return $extender;
}
return NULL;
}