Same name in other branches
  1. 8.x-1.x src/EntityCloneSettingsManager.php \Drupal\entity_clone\EntityCloneSettingsManager::setFormSettings()

Set the entity clone settings.

Parameters

array $settings: The settings from the form.

File

src/EntityCloneSettingsManager.php, line 84

Class

EntityCloneSettingsManager
Manage entity clone configuration.

Namespace

Drupal\entity_clone

Code

public function setFormSettings(array $settings) {
    if (isset($settings['table'])) {
        array_walk_recursive($settings['table'], function (&$item) {
            if ($item == '1') {
                $item = TRUE;
            }
            else {
                $item = FALSE;
            }
        });
        $this->editableConfig
            ->set('form_settings', $settings['table'])
            ->save();
    }
}