PHP Class Piwik\Plugin\SettingsProvider

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 the {@link Piwik\Plugins\ExampleSettingsPlugin\ExampleSettingsPlugin} plugin.
Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Manager $pluginManager )
getAllMeasurableSettings ( integer $idSite, string | null $idMeasurableType = null ) : MeasurableSettings[]
getAllSystemSettings ( ) : SystemSettings[] Returns all available system settings. A plugin has to specify a file named SystemSettings.php containing a class named SystemSettings that extends Piwik\Settings\Plugin\SystemSettings in order to be considered as a system setting. Otherwise the settings for a plugin won't be available.
getAllUserSettings ( ) : UserSettings[] Returns all available user settings. A plugin has to specify a file named UserSettings.php containing a class named UserSettings that extends Piwik\Settings\Plugin\UserSettings in order to be considered as a plugin setting. Otherwise the settings for a plugin won't be available.
getMeasurableSettings ( string $pluginName, integer $idSite, string | null $idType = null ) : MeasurableSettings | null
getSystemSettings ( string $pluginName ) : SystemSettings | null Get user settings implemented by a specific plugin (if implemented by this plugin).
getUserSettings ( string $pluginName ) : UserSettings | null Get user settings implemented by a specific plugin (if implemented by this plugin).

Private Methods

Méthode Description
getLoadedAndActivated ( $pluginName )

Method Details

__construct() public méthode

public __construct ( Manager $pluginManager )
$pluginManager Manager

getAllMeasurableSettings() public méthode

public getAllMeasurableSettings ( integer $idSite, string | null $idMeasurableType = null ) : MeasurableSettings[]
$idSite integer The ID of a site. If a site is about to be created pass idSite = 0.
$idMeasurableType string | null If null, idType will be detected automatically if the site already exists. Only needed to set a value when idSite = 0 (this is the case when a site is about) to be created.
Résultat Piwik\Settings\Measurable\MeasurableSettings[]

getAllSystemSettings() public méthode

Returns all available system settings. A plugin has to specify a file named SystemSettings.php containing a class named SystemSettings that extends Piwik\Settings\Plugin\SystemSettings in order to be considered as a system setting. Otherwise the settings for a plugin won't be available.
public getAllSystemSettings ( ) : SystemSettings[]
Résultat Piwik\Settings\Plugin\SystemSettings[] An array containing array([pluginName] => [setting instance]).

getAllUserSettings() public méthode

Returns all available user settings. A plugin has to specify a file named UserSettings.php containing a class named UserSettings that extends Piwik\Settings\Plugin\UserSettings in order to be considered as a plugin setting. Otherwise the settings for a plugin won't be available.
public getAllUserSettings ( ) : UserSettings[]
Résultat Piwik\Settings\Plugin\UserSettings[] An array containing array([pluginName] => [setting instance]).

getMeasurableSettings() public méthode

public getMeasurableSettings ( string $pluginName, integer $idSite, string | null $idType = null ) : MeasurableSettings | null
$pluginName string The name of a plugin.
$idSite integer The ID of a site. If a site is about to be created pass idSite = 0.
$idType string | null If null, idType will be detected automatically if the site already exists. Only needed to set a value when idSite = 0 (this is the case when a site is about) to be created.
Résultat Piwik\Settings\Measurable\MeasurableSettings | null Returns null if no MeasurableSettings implemented by this plugin or when plugin is not loaded and activated. Returns an instance of the settings otherwise.

getSystemSettings() public méthode

Get user settings implemented by a specific plugin (if implemented by this plugin).
public getSystemSettings ( string $pluginName ) : SystemSettings | null
$pluginName string
Résultat Piwik\Settings\Plugin\SystemSettings | null

getUserSettings() public méthode

Get user settings implemented by a specific plugin (if implemented by this plugin).
public getUserSettings ( string $pluginName ) : UserSettings | null
$pluginName string
Résultat Piwik\Settings\Plugin\UserSettings | null