PHP Class Piwik\Plugin\API

Plugins that want to expose functionality through the Reporting API should create a class that extends this one. Every public method in that class that is not annotated with **@ignore** will be callable through Piwik's Web API. _Note: If your plugin calculates and stores reports, they should be made available through the API._ ### Examples **Defining an API for a plugin** class API extends \Piwik\Plugin\API { public function myMethod($idSite, $period, $date, $segment = false) { $dataTable = // ... get some data ... return $dataTable; } } **Linking to an API method** Link
Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Méthode Description
getInstance ( ) : static Returns the singleton instance for the derived class. If the singleton instance has not been created, this method will create it.
setSingletonInstance ( $instance ) Sets the singleton instance. For testing purposes.
unsetAllInstances ( ) Used in tests only
unsetInstance ( ) Used in tests only

Method Details

getInstance() public static méthode

Returns the singleton instance for the derived class. If the singleton instance has not been created, this method will create it.
public static getInstance ( ) : static
Résultat static

setSingletonInstance() public static méthode

Sets the singleton instance. For testing purposes.
Deprecation:
public static setSingletonInstance ( $instance )

unsetAllInstances() public static méthode

Used in tests only
Deprecation:
public static unsetAllInstances ( )

unsetInstance() public static méthode

Used in tests only
Deprecation:
public static unsetInstance ( )