src/Sulu/Bundle/SecurityBundle/Controller/ResettingController.php
private function changePassword(UserInterface $user, $password)
    {
        if ('' === $password) {
            throw new MissingPasswordException();
        }
        $em = $this->getDoctrine()->getManager();
        $user->setPassword($this->encodePassword($user, $password, $user->getSalt()));
        $em->persist($user);
        $em->flush();
    }
private function changePassword(UserInterface $user, $password)
    {
        if ('' === $password) {
            throw new MissingPasswordException();
        }
        $em = $this->getDoctrine()->getManager();
        $user->setPassword($this->encodePassword($user, $password, $user->getSalt()));
        $em->persist($user);
        $em->flush();
    }
private function changePassword ( UserInterface $ user , $ password ) { if ( '' === $ password ) { throw new MissingPasswordException ( ) ; } $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ user -> setPassword ( $ this -> encodePassword ( $ user , $ password , $ user -> getSalt ( ) ) ) ; $ em -> persist ( $ user ) ; $ em -> flush ( ) ; }
Changes the password of a user.

@param UserInterface $user
@param string $password

@throws MissingPasswordException
Changes the password of a user .