File tree 2 files changed +5
-13
lines changed
2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 9
9
10
10
namespace Webfactory \Bundle \PolyglotBundle \Doctrine ;
11
11
12
- use Doctrine \Common \EventSubscriber ;
13
12
use Doctrine \ORM \EntityManager ;
14
13
use Doctrine \ORM \Event \PostFlushEventArgs ;
15
14
use Doctrine \ORM \Event \PreFlushEventArgs ;
20
19
use WeakReference ;
21
20
use Webfactory \Bundle \PolyglotBundle \Locale \DefaultLocaleProvider ;
22
21
23
- final class PolyglotListener implements EventSubscriber
22
+ final class PolyglotListener
24
23
{
25
24
private const CACHE_SALT = '$WebfactoryPolyglot ' ;
26
25
@@ -56,16 +55,6 @@ public function __construct(
56
55
) {
57
56
}
58
57
59
- public function getSubscribedEvents (): array
60
- {
61
- return [
62
- 'prePersist ' ,
63
- 'postLoad ' ,
64
- 'preFlush ' ,
65
- 'postFlush ' ,
66
- ];
67
- }
68
-
69
58
public function postLoad (LifecycleEventArgs $ event ): void
70
59
{
71
60
// Called when the entity has been hydrated
Original file line number Diff line number Diff line change 7
7
<defaults autowire =" true" autoconfigure =" true" />
8
8
9
9
<service id =" Webfactory\Bundle\PolyglotBundle\Doctrine\PolyglotListener" >
10
- <tag name =" doctrine.event_subscriber" priority =" -100" />
10
+ <tag name =" doctrine.event_listener" priority =" -100" event =" postFlush" />
11
+ <tag name =" doctrine.event_listener" priority =" -100" event =" prePersist" />
12
+ <tag name =" doctrine.event_listener" priority =" -100" event =" preFlush" />
13
+ <tag name =" doctrine.event_listener" priority =" -100" event =" postLoad" />
11
14
<tag name =" monolog.logger" channel =" webfactory_polyglot_bundle" />
12
15
</service >
13
16
You can’t perform that action at this time.
0 commit comments