public function addSetting(Setting $setting)
    {
        $name = $setting->getName();

        if (isset($this->settings[$name])) {
            throw new \Exception(sprintf('A setting with name "%s" does already exist for plugin "%s"', $name, $this->pluginName));
        }

        $this->settings[$name] = $setting;
    }
public function addSetting(Setting $setting)
    {
        $name = $setting->getName();

        if (isset($this->settings[$name])) {
            throw new \Exception(sprintf('A setting with name "%s" does already exist for plugin "%s"', $name, $this->pluginName));
        }

        $this->settings[$name] = $setting;
    }
public function addSetting ( Setting $ setting ) { $ name = $ setting -> getName ( ) ; if ( isset ( $ this -> settings [ $ name ] ) ) { throw new \ Exception ( sprintf ( 'A setting with name "%s" does already exist for plugin "%s"' , $ name , $ this -> pluginName ) ) ; } $ this -> settings [ $ name ] = $ setting ; }
Adds a new setting to the settings container.

@param Setting $setting
@throws \Exception       If there is a setting with the same name that already exists.
If the name contains non-alphanumeric characters.
Adds a new setting to the settings container .