1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* For licensing terms, see /license.txt */ |
4
|
|
|
|
5
|
|
|
declare(strict_types=1); |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\ServiceHelper; |
8
|
|
|
|
9
|
|
|
use Symfony\Component\HttpFoundation\Session\SessionFactoryInterface; |
10
|
|
|
use Symfony\Component\HttpFoundation\Session\SessionInterface; |
11
|
|
|
use Symfony\Component\HttpKernel\KernelInterface; |
12
|
|
|
use Symfony\Component\Messenger\MessageBusInterface; |
13
|
|
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; |
14
|
|
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; |
15
|
|
|
use Symfony\Component\Validator\Validator\ValidatorInterface; |
16
|
|
|
|
17
|
|
|
class ContainerHelper |
18
|
|
|
{ |
19
|
|
|
private AuthorizationCheckerInterface $authorizationChecker; |
20
|
|
|
private TokenStorageInterface $tokenStorage; |
21
|
|
|
private KernelInterface $kernel; |
22
|
|
|
private MessageBusInterface $messengerBus; |
23
|
|
|
private ValidatorInterface $validator; |
24
|
|
|
private SessionFactoryInterface $sessionFactory; |
25
|
|
|
|
26
|
|
|
public function getAuthorizationChecker(): AuthorizationCheckerInterface |
27
|
|
|
{ |
28
|
|
|
return $this->authorizationChecker; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function setAuthorizationChecker(AuthorizationCheckerInterface $authorizationChecker): void |
32
|
|
|
{ |
33
|
|
|
$this->authorizationChecker = $authorizationChecker; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function getTokenStorage(): TokenStorageInterface |
37
|
|
|
{ |
38
|
|
|
return $this->tokenStorage; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function setTokenStorage(TokenStorageInterface $tokenStorage): void |
42
|
|
|
{ |
43
|
|
|
$this->tokenStorage = $tokenStorage; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function getKernel(): KernelInterface |
47
|
|
|
{ |
48
|
|
|
return $this->kernel; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function setKernel(KernelInterface $kernel): void |
52
|
|
|
{ |
53
|
|
|
$this->kernel = $kernel; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function getMessengerBus(): MessageBusInterface |
57
|
|
|
{ |
58
|
|
|
return $this->messengerBus; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function setMessengerBus(MessageBusInterface $messengerBus): void |
62
|
|
|
{ |
63
|
|
|
$this->messengerBus = $messengerBus; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getValidator(): ValidatorInterface |
67
|
|
|
{ |
68
|
|
|
return $this->validator; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function setValidator(ValidatorInterface $validator): void |
72
|
|
|
{ |
73
|
|
|
$this->validator = $validator; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function getSession(): SessionInterface |
77
|
|
|
{ |
78
|
|
|
return $this->sessionFactory->createSession(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
public function setSessionFactory(SessionFactoryInterface $sessionFactory): ContainerHelper |
82
|
|
|
{ |
83
|
|
|
$this->sessionFactory = $sessionFactory; |
84
|
|
|
|
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
} |
88
|
|
|
|