public function Simplesitemap::enableEntityType in Simple XML sitemap 8.3
Same name and namespace in other branches
- 8.2 src/Simplesitemap.php \Drupal\simple_sitemap\Simplesitemap::enableEntityType()
Enables sitemap support for an entity type. Enabled entity types show sitemap settings on their bundle setting forms. If an enabled entity type features bundles (e.g. 'node'), it needs to be set up with setBundleSettings() as well.
Parameters
string $entity_type_id: Entity type id like 'node'.
Return value
$this
File
- src/
Simplesitemap.php, line 418
Class
- Simplesitemap
- Class Simplesitemap @package Drupal\simple_sitemap
Namespace
Drupal\simple_sitemapCode
public function enableEntityType($entity_type_id) {
$enabled_entity_types = $this
->getSetting('enabled_entity_types');
if (!in_array($entity_type_id, $enabled_entity_types)) {
$enabled_entity_types[] = $entity_type_id;
$this
->saveSetting('enabled_entity_types', $enabled_entity_types);
}
return $this;
}