Piwik\Settings\Settings::save PHP Method

save() public method

Saves (persists) the current setting values in the database.
public save ( )
    public function save()
    {
        foreach ($this->settings as $setting) {
            $setting->save();
        }
    }

Usage Example

Example #1
0
 /**
  * Saves (persists) the current setting values in the database.
  *
  * Will trigger an event to notify plugins that a value has been changed.
  */
 public function save()
 {
     parent::save();
     /**
      * Triggered after user settings have been updated.
      *
      * **Example**
      *
      *     Piwik::addAction('UserSettings.updated', function (UserSettings $settings) {
      *         if ($settings->getPluginName() === 'PluginName') {
      *             $value = $settings->someSetting->getValue();
      *             // Do something with the new setting value
      *         }
      *     });
      *
      * @param Settings $settings The plugin settings object.
      */
     Piwik::postEvent('UserSettings.updated', array($this));
 }
All Usage Examples Of Piwik\Settings\Settings::save