/**
  * {@inheritDoc}
  */
 public function getPlainPassword()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPlainPassword', array());
     return parent::getPlainPassword();
 }
예제 #2
0
파일: UserManager.php 프로젝트: dawidf/air
 public function changePassword(User $User)
 {
     if (null == $User->getPlainPassword()) {
         throw new UserException('Nie ustawiono nowego hasła');
     }
     $encoder = $this->encoderFactory->getEncoder($User);
     $encoderPassword = $encoder->encodePassword($User->getPlainPassword(), $User->getSalt());
     $User->setPassword($encoderPassword);
     $em = $this->doctrine->getManager();
     $em->persist($User);
     $em->flush();
     return true;
 }