Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function prePersist(LifecycleEventArgs $event)
- {
- $user = $event->getEntity();
- if (!($user instanceof User)) {
- return;
- }
- $pass = $user -> getPlainPassword();
- if (!empty($plainPassword)) {
- $encoder = $this->get('security.password_encoder');
- $encoded = $encoder->encodePassword($user, $pass);
- $user->setPassword($encoded);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement