| @@ 44-53 (lines=10) @@ | ||
| 41 | /** |
|
| 42 | * {@inheritdoc} |
|
| 43 | */ |
|
| 44 | public function enable(UserInterface $user) |
|
| 45 | { |
|
| 46 | $this->eventDispatcher->dispatch(UserEvents::PRE_ACTIVATE, new GenericEvent($user)); |
|
| 47 | ||
| 48 | $user->setEnabled(true); |
|
| 49 | ||
| 50 | $this->entityManager->flush(); |
|
| 51 | ||
| 52 | $this->eventDispatcher->dispatch(UserEvents::POST_ACTIVATE, new GenericEvent($user)); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * {@inheritdoc} |
|
| @@ 58-67 (lines=10) @@ | ||
| 55 | /** |
|
| 56 | * {@inheritdoc} |
|
| 57 | */ |
|
| 58 | public function disable(UserInterface $user) |
|
| 59 | { |
|
| 60 | $this->eventDispatcher->dispatch(UserEvents::PRE_DEACTIVATE, new GenericEvent($user)); |
|
| 61 | ||
| 62 | $user->setEnabled(false); |
|
| 63 | ||
| 64 | $this->entityManager->flush(); |
|
| 65 | ||
| 66 | $this->eventDispatcher->dispatch(UserEvents::POST_DEACTIVATE, new GenericEvent($user)); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||