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.
Show file Open project: piwik/piwik Class Usage Examples

Public Methods

Method 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

Method Description
getLoadedAndActivated ( $pluginName )

Method Details

__construct() public method

public __construct ( Manager $pluginManager )
$pluginManager Manager

getAllMeasurableSettings() public method

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.
return Piwik\Settings\Measurable\MeasurableSettings[]

getAllSystemSettings() public method

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[]
return Piwik\Settings\Plugin\SystemSettings[] An array containing array([pluginName] => [setting instance]).

getAllUserSettings() public method

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[]
return Piwik\Settings\Plugin\UserSettings[] An array containing array([pluginName] => [setting instance]).

getMeasurableSettings() public method

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.
return 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 method

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

getUserSettings() public method

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