/** * 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)); }
/** * Saves (persists) the current measurable 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 a plugin settings have been updated. * * **Example** * * Piwik::addAction('MeasurableSettings.updated', function (MeasurableSettings $settings) { * $value = $settings->someSetting->getValue(); * // Do something with the new setting value * }); * * @param Settings $settings The plugin settings object. */ Piwik::postEvent('MeasurableSettings.updated', array($this, $this->idSite)); }