コード例 #1
0
ファイル: UserSettings.php プロジェクト: piwik/piwik
 /**
  * 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));
 }
コード例 #2
0
ファイル: MeasurableSettings.php プロジェクト: piwik/piwik
 /**
  * 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));
 }