1 | <?php |
||
23 | class EmailConfirmationListener implements EventSubscriberInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var MailerInterface |
||
27 | */ |
||
28 | protected $mailer; |
||
29 | |||
30 | /** |
||
31 | * @var UrlGeneratorInterface |
||
32 | */ |
||
33 | protected $router; |
||
34 | |||
35 | /** |
||
36 | * @var SessionInterface |
||
37 | */ |
||
38 | protected $session; |
||
39 | |||
40 | /** |
||
41 | * Constructor. |
||
42 | * |
||
43 | * @param MailerInterface $mailer |
||
44 | * @param UrlGeneratorInterface $router |
||
45 | * @param SessionInterface $session |
||
46 | */ |
||
47 | public function __construct(MailerInterface $mailer, UrlGeneratorInterface $router, SessionInterface $session) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public static function getSubscribedEvents() |
||
63 | |||
64 | /** |
||
65 | * Sends an email to the user to activate his account. |
||
66 | * |
||
67 | * @param FormEvent $event |
||
68 | */ |
||
69 | public function sendConfirmationEmail(FormEvent $event) |
||
85 | |||
86 | /** |
||
87 | * Generates a new confirmation token. |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | protected function generateToken() |
||
95 | } |
||
96 |