You are here

public function Simplesitemap::getSetting in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 src/Simplesitemap.php \Drupal\simple_sitemap\Simplesitemap::getSetting()

Returns a specific sitemap setting or a default value if setting does not exist.

Parameters

string $name: Name of the setting, like 'max_links'.

mixed $default: Value to be returned if the setting does not exist in the configuration.

Return value

mixed The current setting from configuration or a default value.

4 calls to Simplesitemap::getSetting()
Simplesitemap::disableEntityType in src/Simplesitemap.php
Disables sitemap support for an entity type. Disabling support for an entity type deletes its sitemap settings permanently and removes sitemap settings from entity forms.
Simplesitemap::enableEntityType in src/Simplesitemap.php
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.
Simplesitemap::entityTypeIsEnabled in src/Simplesitemap.php
Checks if an entity type is enabled in the sitemap settings.
Simplesitemap::generateSitemap in src/Simplesitemap.php
Generates the XML sitemap and saves it to the db.

File

src/Simplesitemap.php, line 142

Class

Simplesitemap
Class Simplesitemap @package Drupal\simple_sitemap

Namespace

Drupal\simple_sitemap

Code

public function getSetting($name, $default = FALSE) {
  $setting = $this->configFactory
    ->get('simple_sitemap.settings')
    ->get($name);
  return NULL !== $setting ? $setting : $default;
}