1 | <?php |
||
23 | class PersistDoctrineUserListener implements EventSubscriberInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var \Doctrine\Bundle\DoctrineBundle\Registry |
||
27 | */ |
||
28 | private $registry; |
||
29 | |||
30 | /** |
||
31 | * @param Registry $registry |
||
32 | */ |
||
33 | function __construct(Registry $registry) |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public static function getSubscribedEvents() |
||
54 | |||
55 | /** |
||
56 | * @param ActivationEvent $event |
||
57 | */ |
||
58 | public function onActivation(ActivationEvent $event) |
||
62 | |||
63 | /** |
||
64 | * @param ActivationEvent $event |
||
65 | */ |
||
66 | public function onDeactivation(ActivationEvent $event) |
||
70 | |||
71 | /** |
||
72 | * @param ChangePasswordEvent $event |
||
73 | */ |
||
74 | public function onChangePassword(ChangePasswordEvent $event) |
||
78 | |||
79 | /** |
||
80 | * @param ResetPasswordRequestEvent $event |
||
81 | */ |
||
82 | public function onResetPasswordRequest(ResetPasswordRequestEvent $event) |
||
86 | |||
87 | /** |
||
88 | * @param UserEvent $event |
||
89 | */ |
||
90 | public function onUserCreated(UserEvent $event) |
||
94 | |||
95 | /** |
||
96 | * @param UserEvent $event |
||
97 | */ |
||
98 | public function onPromoteUser(UserEvent $event) |
||
102 | |||
103 | /** |
||
104 | * @param UserEvent $event |
||
105 | */ |
||
106 | public function onDemoteUser(UserEvent $event) |
||
110 | |||
111 | /** |
||
112 | * @param InteractiveLoginEvent $event |
||
113 | */ |
||
114 | public function onInteractiveLogin(InteractiveLoginEvent $event) |
||
118 | |||
119 | /** |
||
120 | * @param object $user |
||
121 | */ |
||
122 | private function flushUserObjectManager($user) |
||
131 | } |
||
132 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.