PHP Class Piwik\Settings\Plugin\UserSettings

Descendants of this class should implement the {@link init()} method and call the {@link addSetting()} method for each of the plugin's settings. For an example, see {@link Piwik\Plugins\ExampleSettingsPlugin\UserSettings}. $userSettings = new Piwik\Plugins\ExampleSettingsPlugin\UserSettings(); // get instance via dependency injection $userSettings->yourSetting->getValue();
Inheritance: extends Piwik\Settings\Settings
Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ) Constructor.
save ( ) Saves (persists) the current setting values in the database.

Méthodes protégées

Méthode Description
makeSetting ( string $name, mixed $defaultValue, string $type, $configureCallback ) : UserSetting Creates a new user setting.

Method Details

__construct() public méthode

Constructor.
public __construct ( )

makeSetting() protected méthode

Settings will be displayed in the UI depending on the order of makeSetting calls. This means you can define the order of the displayed settings by calling makeSetting first for more important settings.
protected makeSetting ( string $name, mixed $defaultValue, string $type, $configureCallback ) : UserSetting
$name string The name of the setting that shall be created
$defaultValue mixed The default value for this setting. Note the value will not be converted to the specified type.
$type string The PHP internal type the value of this setting should have. Use one of FieldConfig::TYPE_* constancts
Résultat UserSetting Returns an instance of the created measurable setting.

save() public méthode

Will trigger an event to notify plugins that a value has been changed.
public save ( )