You are here

public function Simplesitemap::saveSetting in Simple XML sitemap 8.2

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

Stores a specific sitemap setting in configuration.

Parameters

string $name: Setting name, like 'max_links'.

mixed $setting: The setting to be saved.

Return value

$this

2 calls to Simplesitemap::saveSetting()
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.

File

src/Simplesitemap.php, line 159

Class

Simplesitemap
Class Simplesitemap @package Drupal\simple_sitemap

Namespace

Drupal\simple_sitemap

Code

public function saveSetting($name, $setting) {
  $this->configFactory
    ->getEditable('simple_sitemap.settings')
    ->set($name, $setting)
    ->save();
  return $this;
}