1 | <?php |
||
7 | abstract class AbstractWidget |
||
8 | { |
||
9 | /** |
||
10 | * The number of seconds before each reload. |
||
11 | * |
||
12 | * @var float |
||
13 | */ |
||
14 | protected $reloadTimeout; |
||
15 | |||
16 | /** |
||
17 | * The unique id of the widget being called. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $id; |
||
22 | |||
23 | /** |
||
24 | * Array of widget parameters. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $params = []; |
||
29 | |||
30 | /** |
||
31 | * The widget container template. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $container = 'rinvex/widgets::container'; |
||
36 | |||
37 | /** |
||
38 | * Constructor. |
||
39 | * |
||
40 | * @param array $params |
||
41 | */ |
||
42 | public function __construct(array $params = []) |
||
47 | |||
48 | /** |
||
49 | * Get the widget reload timeout. |
||
50 | * |
||
51 | * @return float|null |
||
52 | */ |
||
53 | public function getReloadTimeout() |
||
57 | |||
58 | /** |
||
59 | * Set the widget reload timeout. |
||
60 | * |
||
61 | * @param float $reloadTimeout |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | public function setReloadTimeout(float $reloadTimeout) |
||
71 | |||
72 | /** |
||
73 | * Get the widget id. |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getId(): string |
||
81 | |||
82 | /** |
||
83 | * Set the widget id. |
||
84 | * |
||
85 | * @param string $id |
||
86 | * |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function setId(string $id) |
||
95 | |||
96 | /** |
||
97 | * Get the widget params. |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | public function getParams(): array |
||
105 | |||
106 | /** |
||
107 | * Set the widget params. |
||
108 | * |
||
109 | * @param array $params |
||
110 | * |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function setParams(array $params) |
||
119 | |||
120 | /** |
||
121 | * Get a widget param. |
||
122 | * |
||
123 | * @return mixed |
||
124 | */ |
||
125 | public function getParam(string $key) |
||
129 | |||
130 | /** |
||
131 | * Set a widget param. |
||
132 | * |
||
133 | * @param mixed $key |
||
134 | * @param mixed $value |
||
135 | * |
||
136 | * @return $this |
||
137 | */ |
||
138 | public function setParam($key, $value) |
||
144 | |||
145 | /** |
||
146 | * Get the widget container. |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | public function getContainer(): string |
||
154 | |||
155 | /** |
||
156 | * Set the widget container. |
||
157 | * |
||
158 | * @param string $container |
||
159 | * |
||
160 | * @return $this |
||
161 | */ |
||
162 | public function setContainer(string $container) |
||
168 | } |
||
169 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.