You are here

protected function SettingsForm::config in Rules 8.3

Retrieves a configuration object.

Parameters

string $name: The name of the configuration object to retrieve. The name corresponds to a configuration file. For

\Drupal::config('book.admin');

, the config object returned will contain the contents of book.admin configuration file.

Return value

\Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig An editable configuration object if the given name is listed in the getEditableConfigNames() method or an immutable configuration object if not.

Overrides ConfigFormBaseTrait::config

1 call to SettingsForm::config()
SettingsForm::buildForm in tests/modules/rules_test_ui_embed/src/Form/SettingsForm.php
Form constructor.

File

tests/modules/rules_test_ui_embed/src/Form/SettingsForm.php, line 38

Class

SettingsForm
Implements the settings form.

Namespace

Drupal\rules_test_ui_embed\Form

Code

protected function config($name) {

  // Get the editable config from the Rules UI handlers, such that any
  // interim changes to the contained Rules component are picked up.
  $config = $this->rulesUiHandler ? $this->rulesUiHandler
    ->getConfig() : NULL;
  if ($config
    ->getName() == $name && in_array($name, $this
    ->getEditableConfigNames())) {
    return $config;
  }
  return parent::config($name);
}