Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BackendInterface.php « Backend « Storage « Settings « core - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 624493460e7eb300b5837780dd6470ffe63324b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */
namespace Piwik\Settings\Storage\Backend;

/**
 * Interface for a storage backend. Any new storage backend must implement this interface.
 */
interface BackendInterface
{

    /**
     * Get an id that identifies the current storage. Eg `Plugin_$pluginName_Settings` could be a storage id
     * for plugin settings. It's kind of like a cache key and the value will be actually used for this by a cache
     * decorator.
     *
     * @return string
     */
    public function getStorageId();

    /**
     * Saves (persists) the current setting values in the database. Always all values that belong to a group of
     * settings or backend needs to be passed. Usually existing values will be deleted and new values will be saved
     * @param array $values An array of key value pairs where $settingName => $settingValue.
     *                      Eg array('settingName1' > 'settingValue1')
     */
    public function save($values);

    /**
     * Deletes all saved settings.
     * @return void
     */
    public function delete();

    /**
     * Loads previously saved setting values and returns them (if some were saved)
     *
     * @return array An array of key value pairs where $settingName => $settingValue.
     *               Eg array('settingName1' > 'settingValue1')
     */
    public function load();
}