/** * Checks for a new password and rehashes if necessary * * @param User $entity * @param PasswordEncoderInterface $encoder * @param string $submittedPassword * * @return string */ public function checkNewPassword(User $entity, PasswordEncoderInterface $encoder, $submittedPassword) { if (!empty($submittedPassword)) { //hash the clear password submitted via the form return $encoder->encodePassword($submittedPassword, $entity->getSalt()); } return $entity->getPassword(); }
/** * {@inheritDoc} */ public function getPassword() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPassword', array()); return parent::getPassword(); }