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