1 | <?php |
||
32 | class Patron extends Plugin |
||
33 | { |
||
34 | use LoggerTrait; |
||
35 | |||
36 | /** |
||
37 | * The before persist token event name |
||
38 | */ |
||
39 | const EVENT_BEFORE_PERSIST_TOKEN = 'beforePersistToken'; |
||
40 | |||
41 | /** |
||
42 | * The after persist token event name |
||
43 | */ |
||
44 | const EVENT_AFTER_PERSIST_TOKEN = 'afterPersistToken'; |
||
45 | |||
46 | /** |
||
47 | * @return string |
||
48 | */ |
||
49 | protected static function getLogFileName(): string |
||
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | 3 | public function init() |
|
128 | |||
129 | |||
130 | /******************************************* |
||
131 | * NAV |
||
132 | *******************************************/ |
||
133 | |||
134 | /** |
||
135 | * @inheritdoc |
||
136 | */ |
||
137 | public function getCpNavItem() |
||
155 | |||
156 | |||
157 | /******************************************* |
||
158 | * SETTINGS |
||
159 | *******************************************/ |
||
160 | |||
161 | /** |
||
162 | * @inheritdoc |
||
163 | * @return SettingsModel |
||
164 | */ |
||
165 | 3 | public function createSettingsModel() |
|
169 | |||
170 | /** |
||
171 | * @inheritdoc |
||
172 | * @throws \yii\base\ExitException |
||
173 | */ |
||
174 | public function getSettingsResponse() |
||
182 | |||
183 | /******************************************* |
||
184 | * QUERIES |
||
185 | *******************************************/ |
||
186 | |||
187 | /** |
||
188 | * @param array $config |
||
189 | * @return ProviderQuery |
||
190 | */ |
||
191 | public function getProviders(array $config = []): ProviderQuery |
||
192 | { |
||
193 | $query = new ProviderQuery(); |
||
194 | |||
195 | QueryHelper::configure( |
||
196 | $query, |
||
197 | $config |
||
198 | ); |
||
199 | |||
200 | return $query; |
||
201 | } |
||
202 | |||
203 | /** |
||
204 | * @param array $config |
||
205 | * @return TokenQuery |
||
206 | */ |
||
207 | public function getTokens(array $config = []): TokenQuery |
||
208 | { |
||
209 | $query = new TokenQuery(); |
||
210 | |||
211 | QueryHelper::configure( |
||
212 | $query, |
||
213 | $config |
||
214 | ); |
||
215 | |||
216 | return $query; |
||
217 | } |
||
218 | |||
219 | |||
220 | /******************************************* |
||
221 | * SERVICES |
||
222 | *******************************************/ |
||
223 | |||
224 | /** |
||
225 | * @noinspection PhpDocMissingThrowsInspection |
||
226 | * @return services\Session |
||
227 | */ |
||
228 | 3 | public function getSession(): services\Session |
|
234 | |||
235 | |||
236 | /******************************************* |
||
237 | * MODULES |
||
238 | *******************************************/ |
||
239 | |||
240 | /** |
||
241 | * @noinspection PhpDocMissingThrowsInspection |
||
242 | * @return cp\Cp |
||
243 | */ |
||
244 | public function getCp(): cp\Cp |
||
250 | |||
251 | |||
252 | /******************************************* |
||
253 | * EVENTS |
||
254 | *******************************************/ |
||
255 | |||
256 | /** |
||
257 | * @param RegisterUrlRulesEvent $event |
||
258 | */ |
||
259 | public static function onRegisterCpUrlRules(RegisterUrlRulesEvent $event) |
||
297 | } |
||
298 |