Skip to content

Commit

Permalink
Fix UserRepository.php
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
schvoy committed Aug 13, 2024
1 parent fbb41a4 commit 3b793f9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ security:
[...]
```

### doctrine.yaml

```yaml
doctrine:
orm:
resolve_target_entities:
Symfony\Component\Security\Core\User\UserInterface: <your-fqcdn-for-your-user-entity-class>
[...]
```

## 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).
Expand All @@ -88,4 +98,4 @@ And after that you can re-enable it:

## Configuration reference

Extra configuration is not needed for this bundle.
Extra configuration is not allowed yet for this bundle.
4 changes: 2 additions & 2 deletions src/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 3b793f9

Please sign in to comment.