setPluginSettings() публичный Метод

public setPluginSettings ( Settings[] $settingsInstances, array $settingValues )
$settingsInstances Piwik\Settings\Settings[]
$settingValues array array('pluginName' => array('settingName' => 'settingValue'))
Пример #1
0
 /**
  * @internal
  * @param array $settingValues  Format: array('PluginName' => array(array('name' => 'SettingName1', 'value' => 'SettingValue1), ..))
  * @throws Exception
  */
 public function setUserSettings($settingValues)
 {
     Piwik::checkUserIsNotAnonymous();
     $pluginsSettings = $this->settingsProvider->getAllUserSettings();
     $this->settingsMetadata->setPluginSettings($pluginsSettings, $settingValues);
     try {
         foreach ($pluginsSettings as $pluginSetting) {
             $pluginSetting->save();
         }
     } catch (Exception $e) {
         throw new Exception(Piwik::translate('CoreAdminHome_PluginSettingsSaveFailed'));
     }
 }
Пример #2
0
 private function setAndValidateMeasurableSettings($idSite, $idType, $settingValues)
 {
     $measurableSettings = $this->settingsProvider->getAllMeasurableSettings($idSite, $idType);
     $this->settingsMetadata->setPluginSettings($measurableSettings, $settingValues);
     return $measurableSettings;
 }