Skip to content

Commit 3b793f9

Browse files
committed
Fix UserRepository.php
Update README.md
1 parent fbb41a4 commit 3b793f9

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.0.2
4+
5+
* Improve the README.md
6+
* Fix how we reach the Entity Manager from UserRepository
7+
38
## 1.0.1
49

510
* Add missing return type to UserExtension.php

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ security:
7070
[...]
7171
```
7272

73+
### doctrine.yaml
74+
75+
```yaml
76+
doctrine:
77+
orm:
78+
resolve_target_entities:
79+
Symfony\Component\Security\Core\User\UserInterface: <your-fqcdn-for-your-user-entity-class>
80+
[...]
81+
```
82+
7383
## Event subscriber
7484

7585
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:
8898

8999
## Configuration reference
90100

91-
Extra configuration is not needed for this bundle.
101+
Extra configuration is not allowed yet for this bundle.

src/Repository/UserRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function upgradePassword(PasswordAuthenticatedUserInterface $user, string
4141

4242
$user->setPassword($newHashedPassword);
4343

44-
$this->_em->persist($user);
45-
$this->_em->flush();
44+
$this->getEntityManager()->persist($user);
45+
$this->getEntityManager()->flush();
4646
}
4747
}

0 commit comments

Comments
 (0)