diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cc6385..ffbc920 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.0.2 + +* Improve the README.md +* Fix how we reach the Entity Manager from UserRepository + ## 1.0.1 * Add missing return type to UserExtension.php diff --git a/README.md b/README.md index 749db82..5793aed 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,16 @@ security: [...] ``` +### doctrine.yaml + +```yaml +doctrine: + orm: + resolve_target_entities: + Symfony\Component\Security\Core\User\UserInterface: + [...] +``` + ## Event subscriber The `Schvoy\UserBundle\EventSubscriber\PasswordHashingDoctrineEventSubscriber` automatically hashes the plain password, during a new user entity creation or an update (if the password changed). @@ -88,4 +98,4 @@ And after that you can re-enable it: ## Configuration reference -Extra configuration is not needed for this bundle. \ No newline at end of file +Extra configuration is not allowed yet for this bundle. \ No newline at end of file diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index ee3a360..e8e3b50 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -41,7 +41,7 @@ public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $user->setPassword($newHashedPassword); - $this->_em->persist($user); - $this->_em->flush(); + $this->getEntityManager()->persist($user); + $this->getEntityManager()->flush(); } }