1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Framework; |
8
|
|
|
|
9
|
|
|
use Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor; |
10
|
|
|
use Chamilo\CoreBundle\Component\Editor\Editor; |
11
|
|
|
use Chamilo\CoreBundle\Repository\AssetRepository; |
12
|
|
|
use Chamilo\CoreBundle\Repository\CareerRepository; |
13
|
|
|
use Chamilo\CoreBundle\Repository\CourseCategoryRepository; |
14
|
|
|
use Chamilo\CoreBundle\Repository\ExtraFieldOptionsRepository; |
15
|
|
|
use Chamilo\CoreBundle\Repository\ExtraFieldRepository; |
16
|
|
|
use Chamilo\CoreBundle\Repository\GradeBookCategoryRepository; |
17
|
|
|
use Chamilo\CoreBundle\Repository\LanguageRepository; |
18
|
|
|
use Chamilo\CoreBundle\Repository\MessageRepository; |
19
|
|
|
use Chamilo\CoreBundle\Repository\Node\AccessUrlRepository; |
20
|
|
|
use Chamilo\CoreBundle\Repository\Node\CourseRepository; |
21
|
|
|
use Chamilo\CoreBundle\Repository\Node\IllustrationRepository; |
22
|
|
|
use Chamilo\CoreBundle\Repository\Node\MessageAttachmentRepository; |
23
|
|
|
use Chamilo\CoreBundle\Repository\Node\PersonalFileRepository; |
24
|
|
|
use Chamilo\CoreBundle\Repository\Node\TicketMessageAttachmentRepository; |
25
|
|
|
use Chamilo\CoreBundle\Repository\Node\UsergroupRepository; |
26
|
|
|
use Chamilo\CoreBundle\Repository\Node\UserRepository; |
27
|
|
|
use Chamilo\CoreBundle\Repository\PromotionRepository; |
28
|
|
|
use Chamilo\CoreBundle\Repository\SequenceRepository; |
29
|
|
|
use Chamilo\CoreBundle\Repository\SequenceResourceRepository; |
30
|
|
|
use Chamilo\CoreBundle\Repository\SessionRepository; |
31
|
|
|
use Chamilo\CoreBundle\Repository\SkillRepository; |
32
|
|
|
use Chamilo\CoreBundle\Repository\SysAnnouncementRepository; |
33
|
|
|
use Chamilo\CoreBundle\Repository\TagRepository; |
34
|
|
|
use Chamilo\CoreBundle\Repository\TrackExerciseRepository; |
35
|
|
|
use Chamilo\CoreBundle\Serializer\UserToJsonNormalizer; |
36
|
|
|
use Chamilo\CoreBundle\Settings\SettingsManager; |
37
|
|
|
use Chamilo\CoreBundle\Tool\ToolChain; |
38
|
|
|
use Chamilo\CourseBundle\Repository\CAnnouncementAttachmentRepository; |
39
|
|
|
use Chamilo\CourseBundle\Repository\CAnnouncementRepository; |
40
|
|
|
use Chamilo\CourseBundle\Repository\CAttendanceRepository; |
41
|
|
|
use Chamilo\CourseBundle\Repository\CCalendarEventAttachmentRepository; |
42
|
|
|
use Chamilo\CourseBundle\Repository\CCalendarEventRepository; |
43
|
|
|
use Chamilo\CourseBundle\Repository\CCourseDescriptionRepository; |
44
|
|
|
use Chamilo\CourseBundle\Repository\CDocumentRepository; |
45
|
|
|
use Chamilo\CourseBundle\Repository\CExerciseCategoryRepository; |
46
|
|
|
use Chamilo\CourseBundle\Repository\CForumAttachmentRepository; |
47
|
|
|
use Chamilo\CourseBundle\Repository\CForumCategoryRepository; |
48
|
|
|
use Chamilo\CourseBundle\Repository\CForumPostRepository; |
49
|
|
|
use Chamilo\CourseBundle\Repository\CForumRepository; |
50
|
|
|
use Chamilo\CourseBundle\Repository\CForumThreadRepository; |
51
|
|
|
use Chamilo\CourseBundle\Repository\CGlossaryRepository; |
52
|
|
|
use Chamilo\CourseBundle\Repository\CGroupCategoryRepository; |
53
|
|
|
use Chamilo\CourseBundle\Repository\CGroupRepository; |
54
|
|
|
use Chamilo\CourseBundle\Repository\CLinkCategoryRepository; |
55
|
|
|
use Chamilo\CourseBundle\Repository\CLinkRepository; |
56
|
|
|
use Chamilo\CourseBundle\Repository\CLpCategoryRepository; |
57
|
|
|
use Chamilo\CourseBundle\Repository\CLpItemRepository; |
58
|
|
|
use Chamilo\CourseBundle\Repository\CLpRepository; |
59
|
|
|
use Chamilo\CourseBundle\Repository\CNotebookRepository; |
60
|
|
|
use Chamilo\CourseBundle\Repository\CQuizQuestionCategoryRepository; |
61
|
|
|
use Chamilo\CourseBundle\Repository\CQuizQuestionRepository; |
62
|
|
|
use Chamilo\CourseBundle\Repository\CQuizRepository; |
63
|
|
|
use Chamilo\CourseBundle\Repository\CShortcutRepository; |
64
|
|
|
use Chamilo\CourseBundle\Repository\CStudentPublicationAssignmentRepository; |
65
|
|
|
use Chamilo\CourseBundle\Repository\CStudentPublicationCommentRepository; |
66
|
|
|
use Chamilo\CourseBundle\Repository\CStudentPublicationCorrectionRepository; |
67
|
|
|
use Chamilo\CourseBundle\Repository\CStudentPublicationRepository; |
68
|
|
|
use Chamilo\CourseBundle\Repository\CSurveyInvitationRepository; |
69
|
|
|
use Chamilo\CourseBundle\Repository\CSurveyQuestionRepository; |
70
|
|
|
use Chamilo\CourseBundle\Repository\CSurveyRepository; |
71
|
|
|
use Chamilo\CourseBundle\Repository\CThematicAdvanceRepository; |
72
|
|
|
use Chamilo\CourseBundle\Repository\CThematicPlanRepository; |
73
|
|
|
use Chamilo\CourseBundle\Repository\CThematicRepository; |
74
|
|
|
use Chamilo\CourseBundle\Repository\CToolIntroRepository; |
75
|
|
|
use Chamilo\CourseBundle\Repository\CWikiRepository; |
76
|
|
|
use Chamilo\CourseBundle\Settings\SettingsCourseManager; |
77
|
|
|
use Chamilo\LtiBundle\Repository\ExternalToolRepository; |
78
|
|
|
use Database; |
79
|
|
|
use Doctrine\ORM\EntityManager; |
80
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface; |
81
|
|
|
use Symfony\Component\Form\FormFactory; |
82
|
|
|
use Symfony\Component\HttpFoundation\Request; |
83
|
|
|
use Symfony\Component\HttpFoundation\Session\Session; |
84
|
|
|
use Symfony\Component\Mailer\Mailer; |
85
|
|
|
use Symfony\Component\Routing\Router; |
86
|
|
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; |
87
|
|
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; |
88
|
|
|
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; |
89
|
|
|
use Symfony\Contracts\Translation\TranslatorInterface; |
90
|
|
|
use Twig\Environment; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Symfony services for the legacy Chamilo code. |
94
|
|
|
*/ |
95
|
|
|
class Container |
96
|
|
|
{ |
97
|
|
|
public static ?ContainerInterface $container = null; |
98
|
|
|
public static ?Request $request = null; |
99
|
|
|
public static ?TranslatorInterface $translator = null; |
100
|
|
|
public static Environment $twig; |
101
|
|
|
public static string $legacyTemplate = '@ChamiloCore/Layout/layout_one_col.html.twig'; |
102
|
|
|
|
103
|
|
|
public static function setContainer(ContainerInterface $container): void |
104
|
|
|
{ |
105
|
|
|
self::$container = $container; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return array|bool|float|int|string|null |
110
|
|
|
*/ |
111
|
|
|
public static function getParameter(string $parameter) |
112
|
|
|
{ |
113
|
|
|
if (self::$container->hasParameter($parameter)) { |
|
|
|
|
114
|
|
|
return self::$container->getParameter($parameter); |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
return false; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
public static function getEnvironment(): string |
121
|
|
|
{ |
122
|
|
|
return self::$container->get('kernel')->getEnvironment(); |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
public static function getLogDir(): string |
126
|
|
|
{ |
127
|
|
|
return self::$container->get('kernel')->getLogDir(); |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
public static function getCacheDir(): string |
131
|
|
|
{ |
132
|
|
|
return self::$container->get('kernel')->getCacheDir().'/'; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @return string |
137
|
|
|
*/ |
138
|
|
|
public static function getProjectDir() |
139
|
|
|
{ |
140
|
|
|
if (null !== self::$container) { |
141
|
|
|
return self::$container->get('kernel')->getProjectDir().'/'; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
return str_replace('\\', '/', realpath(__DIR__.'/../../../')).'/'; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @return bool |
149
|
|
|
*/ |
150
|
|
|
public static function isInstalled() |
151
|
|
|
{ |
152
|
|
|
return self::$container->get('kernel')->isInstalled(); |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
public static function getMessengerBus() |
156
|
|
|
{ |
157
|
|
|
return self::$container->get('messenger.bus.default'); |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* @return Environment |
162
|
|
|
*/ |
163
|
|
|
public static function getTwig() |
164
|
|
|
{ |
165
|
|
|
return self::$twig; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @return Editor |
170
|
|
|
*/ |
171
|
|
|
public static function getHtmlEditor() |
172
|
|
|
{ |
173
|
|
|
return self::$container->get(CkEditor::class); |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @return null|Request |
178
|
|
|
*/ |
179
|
|
|
public static function getRequest() |
180
|
|
|
{ |
181
|
|
|
if (null === self::$container) { |
182
|
|
|
return null; |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
if (!empty(self::$request)) { |
186
|
|
|
return self::$request; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
return self::$container->get('request_stack')->getCurrentRequest(); |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
public static function setRequest(Request $request): void |
193
|
|
|
{ |
194
|
|
|
self::$request = $request; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* @return false|Session |
199
|
|
|
*/ |
200
|
|
|
public static function getSession() |
201
|
|
|
{ |
202
|
|
|
if (null !== self::$container) { |
203
|
|
|
return self::$container->get('session'); |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
return false; |
207
|
|
|
} |
208
|
|
|
|
209
|
|
|
/** |
210
|
|
|
* @return AuthorizationChecker |
211
|
|
|
*/ |
212
|
|
|
public static function getAuthorizationChecker() |
213
|
|
|
{ |
214
|
|
|
return self::$container->get('security.authorization_checker'); |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @return TokenStorage|TokenStorageInterface |
219
|
|
|
*/ |
220
|
|
|
public static function getTokenStorage() |
221
|
|
|
{ |
222
|
|
|
return self::$container->get('security.token_storage'); |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* @return TranslatorInterface |
227
|
|
|
*/ |
228
|
|
|
public static function getTranslator() |
229
|
|
|
{ |
230
|
|
|
if (null !== self::$translator) { |
231
|
|
|
return self::$translator; |
232
|
|
|
} |
233
|
|
|
|
234
|
|
|
//if (self::$container->has('translator')) { |
235
|
|
|
return self::$container->get('translator'); |
236
|
|
|
//} |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
public static function getMailer(): Mailer |
240
|
|
|
{ |
241
|
|
|
return self::$container->get(Mailer::class); |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
public static function getSettingsManager(): SettingsManager |
245
|
|
|
{ |
246
|
|
|
return self::$container->get(SettingsManager::class); |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
public static function getCourseSettingsManager(): SettingsCourseManager |
250
|
|
|
{ |
251
|
|
|
return self::$container->get(SettingsCourseManager::class); |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @return EntityManager |
256
|
|
|
*/ |
257
|
|
|
public static function getEntityManager() |
258
|
|
|
{ |
259
|
|
|
return Database::getManager(); |
260
|
|
|
} |
261
|
|
|
|
262
|
|
|
public static function getAssetRepository(): AssetRepository |
263
|
|
|
{ |
264
|
|
|
return self::$container->get(AssetRepository::class); |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
public static function getAttendanceRepository(): CAttendanceRepository |
268
|
|
|
{ |
269
|
|
|
return self::$container->get(CAttendanceRepository::class); |
270
|
|
|
} |
271
|
|
|
|
272
|
|
|
public static function getAnnouncementRepository(): CAnnouncementRepository |
273
|
|
|
{ |
274
|
|
|
return self::$container->get(CAnnouncementRepository::class); |
275
|
|
|
} |
276
|
|
|
|
277
|
|
|
public static function getAccessUrlRepository(): AccessUrlRepository |
278
|
|
|
{ |
279
|
|
|
return self::$container->get(AccessUrlRepository::class); |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
public static function getAnnouncementAttachmentRepository(): CAnnouncementAttachmentRepository |
283
|
|
|
{ |
284
|
|
|
return self::$container->get(CAnnouncementAttachmentRepository::class); |
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
public static function getTicketMessageAttachmentRepository(): TicketMessageAttachmentRepository |
288
|
|
|
{ |
289
|
|
|
return self::$container->get(TicketMessageAttachmentRepository::class); |
290
|
|
|
} |
291
|
|
|
|
292
|
|
|
public static function getCourseRepository(): CourseRepository |
293
|
|
|
{ |
294
|
|
|
return self::$container->get(CourseRepository::class); |
295
|
|
|
} |
296
|
|
|
|
297
|
|
|
public static function getCareerRepository(): CareerRepository |
298
|
|
|
{ |
299
|
|
|
return self::$container->get(CareerRepository::class); |
300
|
|
|
} |
301
|
|
|
|
302
|
|
|
public static function getCourseCategoryRepository(): CourseCategoryRepository |
303
|
|
|
{ |
304
|
|
|
return self::$container->get(CourseCategoryRepository::class); |
305
|
|
|
} |
306
|
|
|
|
307
|
|
|
public static function getCourseDescriptionRepository(): CCourseDescriptionRepository |
308
|
|
|
{ |
309
|
|
|
return self::$container->get(CCourseDescriptionRepository::class); |
310
|
|
|
} |
311
|
|
|
|
312
|
|
|
public static function getCalendarEventRepository(): CCalendarEventRepository |
313
|
|
|
{ |
314
|
|
|
return self::$container->get(CCalendarEventRepository::class); |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
public static function getCalendarEventAttachmentRepository(): CCalendarEventAttachmentRepository |
318
|
|
|
{ |
319
|
|
|
return self::$container->get(CCalendarEventAttachmentRepository::class); |
320
|
|
|
} |
321
|
|
|
|
322
|
|
|
public static function getDocumentRepository(): CDocumentRepository |
323
|
|
|
{ |
324
|
|
|
return self::$container->get(CDocumentRepository::class); |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
public static function getExerciseCategoryRepository(): CExerciseCategoryRepository |
328
|
|
|
{ |
329
|
|
|
return self::$container->get(CExerciseCategoryRepository::class); |
330
|
|
|
} |
331
|
|
|
|
332
|
|
|
public static function getExternalToolRepository(): ExternalToolRepository |
333
|
|
|
{ |
334
|
|
|
return self::$container->get(ExternalToolRepository::class); |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
public static function getExtraFieldRepository(): ExtraFieldRepository |
338
|
|
|
{ |
339
|
|
|
return self::$container->get(ExtraFieldRepository::class); |
340
|
|
|
} |
341
|
|
|
|
342
|
|
|
public static function getExtraFieldOptionsRepository(): ExtraFieldOptionsRepository |
343
|
|
|
{ |
344
|
|
|
return self::$container->get(ExtraFieldOptionsRepository::class); |
345
|
|
|
} |
346
|
|
|
|
347
|
|
|
public static function getGlossaryRepository(): CGlossaryRepository |
348
|
|
|
{ |
349
|
|
|
return self::$container->get(CGlossaryRepository::class); |
350
|
|
|
} |
351
|
|
|
|
352
|
|
|
public static function getGradeBookCategoryRepository(): GradeBookCategoryRepository |
353
|
|
|
{ |
354
|
|
|
return self::$container->get(GradeBookCategoryRepository::class); |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
public static function getGroupRepository(): CGroupRepository |
358
|
|
|
{ |
359
|
|
|
return self::$container->get(CGroupRepository::class); |
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
public static function getGroupCategoryRepository(): CGroupCategoryRepository |
363
|
|
|
{ |
364
|
|
|
return self::$container->get(CGroupCategoryRepository::class); |
365
|
|
|
} |
366
|
|
|
|
367
|
|
|
public static function getForumRepository(): CForumRepository |
368
|
|
|
{ |
369
|
|
|
return self::$container->get(CForumRepository::class); |
370
|
|
|
} |
371
|
|
|
|
372
|
|
|
public static function getForumCategoryRepository(): CForumCategoryRepository |
373
|
|
|
{ |
374
|
|
|
return self::$container->get(CForumCategoryRepository::class); |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
public static function getForumPostRepository(): CForumPostRepository |
378
|
|
|
{ |
379
|
|
|
return self::$container->get(CForumPostRepository::class); |
380
|
|
|
} |
381
|
|
|
|
382
|
|
|
public static function getForumAttachmentRepository(): CForumAttachmentRepository |
383
|
|
|
{ |
384
|
|
|
return self::$container->get(CForumAttachmentRepository::class); |
385
|
|
|
} |
386
|
|
|
|
387
|
|
|
public static function getForumThreadRepository(): CForumThreadRepository |
388
|
|
|
{ |
389
|
|
|
return self::$container->get(CForumThreadRepository::class); |
390
|
|
|
} |
391
|
|
|
|
392
|
|
|
public static function getIllustrationRepository(): IllustrationRepository |
393
|
|
|
{ |
394
|
|
|
return self::$container->get(IllustrationRepository::class); |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
public static function getQuizRepository(): CQuizRepository |
398
|
|
|
{ |
399
|
|
|
return self::$container->get(CQuizRepository::class); |
400
|
|
|
} |
401
|
|
|
|
402
|
|
|
public static function getQuestionRepository(): CQuizQuestionRepository |
403
|
|
|
{ |
404
|
|
|
return self::$container->get(CQuizQuestionRepository::class); |
405
|
|
|
} |
406
|
|
|
|
407
|
|
|
public static function getQuestionCategoryRepository(): CQuizQuestionCategoryRepository |
408
|
|
|
{ |
409
|
|
|
return self::$container->get(CQuizQuestionCategoryRepository::class); |
410
|
|
|
} |
411
|
|
|
|
412
|
|
|
public static function getLanguageRepository(): LanguageRepository |
413
|
|
|
{ |
414
|
|
|
return self::$container->get(LanguageRepository::class); |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
public static function getLinkRepository(): CLinkRepository |
418
|
|
|
{ |
419
|
|
|
return self::$container->get(CLinkRepository::class); |
420
|
|
|
} |
421
|
|
|
|
422
|
|
|
public static function getLinkCategoryRepository(): CLinkCategoryRepository |
423
|
|
|
{ |
424
|
|
|
return self::$container->get(CLinkCategoryRepository::class); |
425
|
|
|
} |
426
|
|
|
|
427
|
|
|
public static function getLpRepository(): CLpRepository |
428
|
|
|
{ |
429
|
|
|
return self::$container->get(CLpRepository::class); |
430
|
|
|
} |
431
|
|
|
|
432
|
|
|
public static function getLpItemRepository(): CLpItemRepository |
433
|
|
|
{ |
434
|
|
|
return self::$container->get(CLpItemRepository::class); |
435
|
|
|
} |
436
|
|
|
|
437
|
|
|
public static function getLpCategoryRepository(): CLpCategoryRepository |
438
|
|
|
{ |
439
|
|
|
return self::$container->get(CLpCategoryRepository::class); |
440
|
|
|
} |
441
|
|
|
|
442
|
|
|
public static function getMessageRepository(): MessageRepository |
443
|
|
|
{ |
444
|
|
|
return self::$container->get(MessageRepository::class); |
445
|
|
|
} |
446
|
|
|
|
447
|
|
|
public static function getMessageAttachmentRepository(): MessageAttachmentRepository |
448
|
|
|
{ |
449
|
|
|
return self::$container->get(MessageAttachmentRepository::class); |
450
|
|
|
} |
451
|
|
|
|
452
|
|
|
public static function getNotebookRepository(): CNotebookRepository |
453
|
|
|
{ |
454
|
|
|
return self::$container->get(CNotebookRepository::class); |
455
|
|
|
} |
456
|
|
|
|
457
|
|
|
public static function getPersonalFileRepository(): PersonalFileRepository |
458
|
|
|
{ |
459
|
|
|
return self::$container->get(PersonalFileRepository::class); |
460
|
|
|
} |
461
|
|
|
|
462
|
|
|
public static function getPromotionRepository(): PromotionRepository |
463
|
|
|
{ |
464
|
|
|
return self::$container->get(PromotionRepository::class); |
465
|
|
|
} |
466
|
|
|
|
467
|
|
|
public static function getUserRepository(): UserRepository |
468
|
|
|
{ |
469
|
|
|
return self::$container->get(UserRepository::class); |
470
|
|
|
} |
471
|
|
|
|
472
|
|
|
public static function getUsergroupRepository(): UsergroupRepository |
473
|
|
|
{ |
474
|
|
|
return self::$container->get(UsergroupRepository::class); |
475
|
|
|
} |
476
|
|
|
|
477
|
|
|
public static function getUserToJsonNormalizer(): UserToJsonNormalizer |
478
|
|
|
{ |
479
|
|
|
return self::$container->get(UserToJsonNormalizer::class); |
480
|
|
|
} |
481
|
|
|
|
482
|
|
|
public static function getShortcutRepository(): CShortcutRepository |
483
|
|
|
{ |
484
|
|
|
return self::$container->get(CShortcutRepository::class); |
485
|
|
|
} |
486
|
|
|
|
487
|
|
|
public static function getStudentPublicationRepository(): CStudentPublicationRepository |
488
|
|
|
{ |
489
|
|
|
return self::$container->get(CStudentPublicationRepository::class); |
490
|
|
|
} |
491
|
|
|
|
492
|
|
|
public static function getStudentPublicationAssignmentRepository(): CStudentPublicationAssignmentRepository |
493
|
|
|
{ |
494
|
|
|
return self::$container->get(CStudentPublicationAssignmentRepository::class); |
495
|
|
|
} |
496
|
|
|
|
497
|
|
|
public static function getStudentPublicationCommentRepository(): CStudentPublicationCommentRepository |
498
|
|
|
{ |
499
|
|
|
return self::$container->get(CStudentPublicationCommentRepository::class); |
500
|
|
|
} |
501
|
|
|
|
502
|
|
|
public static function getStudentPublicationCorrectionRepository(): CStudentPublicationCorrectionRepository |
503
|
|
|
{ |
504
|
|
|
return self::$container->get(CStudentPublicationCorrectionRepository::class); |
505
|
|
|
} |
506
|
|
|
|
507
|
|
|
public static function getSequenceResourceRepository(): SequenceResourceRepository |
508
|
|
|
{ |
509
|
|
|
return self::$container->get(SequenceResourceRepository::class); |
510
|
|
|
} |
511
|
|
|
|
512
|
|
|
public static function getSequenceRepository(): SequenceRepository |
513
|
|
|
{ |
514
|
|
|
return self::$container->get(SequenceRepository::class); |
515
|
|
|
} |
516
|
|
|
|
517
|
|
|
public static function getSessionRepository(): SessionRepository |
518
|
|
|
{ |
519
|
|
|
return self::$container->get(SessionRepository::class); |
520
|
|
|
} |
521
|
|
|
|
522
|
|
|
public static function getSkillRepository(): SkillRepository |
523
|
|
|
{ |
524
|
|
|
return self::$container->get(SkillRepository::class); |
525
|
|
|
} |
526
|
|
|
|
527
|
|
|
public static function getSurveyRepository(): CSurveyRepository |
528
|
|
|
{ |
529
|
|
|
return self::$container->get(CSurveyRepository::class); |
530
|
|
|
} |
531
|
|
|
|
532
|
|
|
public static function getSurveyInvitationRepository(): CSurveyInvitationRepository |
533
|
|
|
{ |
534
|
|
|
return self::$container->get(CSurveyInvitationRepository::class); |
535
|
|
|
} |
536
|
|
|
|
537
|
|
|
public static function getSurveyQuestionRepository(): CSurveyQuestionRepository |
538
|
|
|
{ |
539
|
|
|
return self::$container->get(CSurveyQuestionRepository::class); |
540
|
|
|
} |
541
|
|
|
|
542
|
|
|
public static function getSysAnnouncementRepository(): SysAnnouncementRepository |
543
|
|
|
{ |
544
|
|
|
return self::$container->get(SysAnnouncementRepository::class); |
545
|
|
|
} |
546
|
|
|
|
547
|
|
|
public static function getTagRepository(): TagRepository |
548
|
|
|
{ |
549
|
|
|
return self::$container->get(TagRepository::class); |
550
|
|
|
} |
551
|
|
|
|
552
|
|
|
public static function getThematicRepository(): CThematicRepository |
553
|
|
|
{ |
554
|
|
|
return self::$container->get(CThematicRepository::class); |
555
|
|
|
} |
556
|
|
|
|
557
|
|
|
public static function getThematicPlanRepository(): CThematicPlanRepository |
558
|
|
|
{ |
559
|
|
|
return self::$container->get(CThematicPlanRepository::class); |
560
|
|
|
} |
561
|
|
|
|
562
|
|
|
public static function getThematicAdvanceRepository(): CThematicAdvanceRepository |
563
|
|
|
{ |
564
|
|
|
return self::$container->get(CThematicAdvanceRepository::class); |
565
|
|
|
} |
566
|
|
|
|
567
|
|
|
public static function getTrackExerciseRepository(): TrackExerciseRepository |
568
|
|
|
{ |
569
|
|
|
return self::$container->get(TrackExerciseRepository::class); |
570
|
|
|
} |
571
|
|
|
|
572
|
|
|
public static function getWikiRepository(): CWikiRepository |
573
|
|
|
{ |
574
|
|
|
return self::$container->get(CWikiRepository::class); |
575
|
|
|
} |
576
|
|
|
|
577
|
|
|
public static function getToolIntroRepository(): CToolIntroRepository |
578
|
|
|
{ |
579
|
|
|
return self::$container->get(CToolIntroRepository::class); |
580
|
|
|
} |
581
|
|
|
|
582
|
|
|
public static function getFormFactory(): FormFactory |
583
|
|
|
{ |
584
|
|
|
return self::$container->get('form.factory'); |
585
|
|
|
} |
586
|
|
|
|
587
|
|
|
/** |
588
|
|
|
* @param string $type error|success|warning|danger |
589
|
|
|
*/ |
590
|
|
|
public static function addFlash(string $message, string $type = 'success'): void |
591
|
|
|
{ |
592
|
|
|
$session = self::getSession(); |
593
|
|
|
$session->getFlashBag()->add($type, $message); |
594
|
|
|
} |
595
|
|
|
|
596
|
|
|
public static function getRouter(): Router |
597
|
|
|
{ |
598
|
|
|
return self::$container->get('router'); |
599
|
|
|
} |
600
|
|
|
|
601
|
|
|
public static function getToolChain(): ToolChain |
602
|
|
|
{ |
603
|
|
|
return self::$container->get(ToolChain::class); |
604
|
|
|
} |
605
|
|
|
|
606
|
|
|
public static function setLegacyServices(ContainerInterface $container): void |
607
|
|
|
{ |
608
|
|
|
$doctrine = $container->get('doctrine'); |
609
|
|
|
Database::setConnection($doctrine->getConnection()); |
610
|
|
|
/** @var EntityManager $em */ |
611
|
|
|
$em = $doctrine->getManager(); |
612
|
|
|
Database::setManager($em); |
613
|
|
|
} |
614
|
|
|
} |
615
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.