1<?php
2namespace LimeSurvey\PluginManager;
3interface iPlugin
4{
5
6    /**
7     * Should return the description for this plugin
8     * Constructor for the plugin
9     * @param PluginManager $manager    The plugin manager instantiating the object
10     * @param int           $id         The id for storage
11     */
12    public function __construct(PluginManager $manager, $id);
13
14    /**
15     * Return the description for this plugin
16     */
17    public static function getDescription();
18
19    /**
20     * Get the current event this plugin is responding to
21     *
22     * @return PluginEvent
23     */
24    public function getEvent();
25
26    /**
27     * Get the id of this plugin (set by PluginManager on instantiation)
28     *
29     * @return int
30     */
31    public function getId();
32
33    /**
34     * Provides meta data on the plugin settings that are available for this plugin.
35     * This does not include enable / disable; a disabled plugin is never loaded.
36     * @param boolean $getValues Set to false to not get the current value for each plugin setting.
37     * @return array
38     */
39    public function getPluginSettings($getValues = true);
40
41    /**
42     * Gets the name for the plugin, this must be unique.
43     * @return string Plugin name, max length: 20.
44     */
45    public static function getName();
46    /**
47     * Returns a reference to the storage interface for the plugin.
48     * @return iPluginStorage
49     */
50    public function getStore();
51
52    /**
53     * Saves the settings for this plugin
54     *
55     * Assumes an array with valid key/value pairs is passed.
56     *
57     * @param array $aSettings An array with key/value pairs for all plugin settings
58     */
59    public function saveSettings($aSettings);
60
61    /**
62     * Set the event to the plugin, this method is executed by the PluginManager
63     * just before dispatching the event.
64     *
65     * @param PluginEvent $event
66     * @return PluginBase
67     */
68    public function setEvent(PluginEvent $event);
69}
70