1 | <?php |
||
32 | class Patron extends Plugin |
||
33 | { |
||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | 15 | public function init() |
|
88 | |||
89 | /** |
||
90 | * @inheritdoc |
||
91 | */ |
||
92 | public function getCpNavItem() |
||
110 | |||
111 | /** |
||
112 | * @inheritdoc |
||
113 | * @return SettingsModel |
||
114 | */ |
||
115 | public function createSettingsModel() |
||
119 | |||
120 | /** |
||
121 | * @inheritdoc |
||
122 | * @throws \yii\base\ExitException |
||
123 | */ |
||
124 | public function getSettingsResponse() |
||
132 | |||
133 | /******************************************* |
||
134 | * SERVICES |
||
135 | *******************************************/ |
||
136 | |||
137 | /** |
||
138 | * @noinspection PhpDocMissingThrowsInspection |
||
139 | * @return services\Providers |
||
140 | */ |
||
141 | 3 | public function getProviders(): services\Providers |
|
142 | { |
||
143 | /** @noinspection PhpUnhandledExceptionInspection */ |
||
144 | /** @noinspection PhpIncompatibleReturnTypeInspection */ |
||
145 | 3 | return $this->get('providers'); |
|
146 | } |
||
147 | |||
148 | /** |
||
149 | * @noinspection PhpDocMissingThrowsInspection |
||
150 | * @return services\Tokens |
||
151 | */ |
||
152 | 3 | public function getTokens(): services\Tokens |
|
153 | { |
||
154 | /** @noinspection PhpUnhandledExceptionInspection */ |
||
155 | /** @noinspection PhpIncompatibleReturnTypeInspection */ |
||
156 | 3 | return $this->get('tokens'); |
|
157 | } |
||
158 | |||
159 | /** |
||
160 | * @noinspection PhpDocMissingThrowsInspection |
||
161 | * @return services\ManageProviders |
||
162 | */ |
||
163 | 3 | public function manageProviders(): services\ManageProviders |
|
164 | { |
||
165 | /** @noinspection PhpUnhandledExceptionInspection */ |
||
166 | /** @noinspection PhpIncompatibleReturnTypeInspection */ |
||
167 | 3 | return $this->get('manageProviders'); |
|
168 | } |
||
169 | |||
170 | /** |
||
171 | * @noinspection PhpDocMissingThrowsInspection |
||
172 | * @return services\ManageTokens |
||
173 | */ |
||
174 | 3 | public function manageTokens(): services\ManageTokens |
|
175 | { |
||
176 | /** @noinspection PhpUnhandledExceptionInspection */ |
||
177 | /** @noinspection PhpIncompatibleReturnTypeInspection */ |
||
178 | 3 | return $this->get('manageTokens'); |
|
179 | } |
||
180 | |||
181 | /** |
||
182 | * @noinspection PhpDocMissingThrowsInspection |
||
183 | * @return services\Session |
||
184 | */ |
||
185 | 3 | public function getSession(): services\Session |
|
191 | |||
192 | |||
193 | /******************************************* |
||
194 | * MODULES |
||
195 | *******************************************/ |
||
196 | |||
197 | /** |
||
198 | * @noinspection PhpDocMissingThrowsInspection |
||
199 | * @return cp\Cp |
||
200 | */ |
||
201 | public function getCp(): cp\Cp |
||
207 | |||
208 | /******************************************* |
||
209 | * EVENTS |
||
210 | *******************************************/ |
||
211 | |||
212 | /** |
||
213 | * @param RegisterUrlRulesEvent $event |
||
214 | */ |
||
215 | public static function onRegisterCpUrlRules(RegisterUrlRulesEvent $event) |
||
231 | |||
232 | |||
233 | /******************************************* |
||
234 | * LOGGING |
||
235 | *******************************************/ |
||
236 | |||
237 | /** |
||
238 | * Logs an informative message. |
||
239 | * |
||
240 | * @param $message |
||
241 | * @param string $category |
||
242 | */ |
||
243 | public static function info($message, $category = 'patron') |
||
247 | |||
248 | /** |
||
249 | * Logs a warning message. |
||
250 | * |
||
251 | * @param $message |
||
252 | * @param string $category |
||
253 | */ |
||
254 | public static function warning($message, $category = 'patron') |
||
258 | |||
259 | /** |
||
260 | * Logs an error message. |
||
261 | * |
||
262 | * @param $message |
||
263 | * @param string $category |
||
264 | */ |
||
265 | public static function error($message, $category = 'patron') |
||
269 | } |
||
270 |