1 | <?php |
||
12 | class LocaleSubscriber implements EventSubscriberInterface |
||
|
|||
13 | { |
||
14 | private $defaultLocale; |
||
15 | |||
16 | /** |
||
17 | * Constructor. |
||
18 | * |
||
19 | * @param $defaultLocale the default locale of the application |
||
20 | */ |
||
21 | public function __construct($defaultLocale) |
||
25 | |||
26 | /** |
||
27 | * @param GetResponseEvent $event |
||
28 | * |
||
29 | * method called on kernel request used only to persist locale in session |
||
30 | */ |
||
31 | public function onKernelRequest(GetResponseEvent $event) |
||
47 | |||
48 | /** |
||
49 | * This method will be called on user login in order to set the victoire locale. |
||
50 | * |
||
51 | * @param InteractiveLoginEvent $event |
||
52 | */ |
||
53 | public function onLogin(InteractiveLoginEvent $event) |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public static function getSubscribedEvents() |
||
73 | } |
||
74 |