File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -50,4 +50,6 @@ model.sql
5050/public /assets /* .txt
5151/.env.local
5252/.phpunit.cache /
53- docker-compose /mysql /model /* .sql
53+ docker-compose /mysql /model /* .sql
54+ public /assets /css /* .css.map
55+ public /assets /* .js.map
Original file line number Diff line number Diff line change @@ -127,4 +127,12 @@ public function getByVerificationEmailToken(string $token): ?User
127127 'email_verified_token_hash ' => User::createConfirmationTokenHash ($ token )
128128 ]);
129129 }
130+
131+ public function getByIdWithGroups (int $ id ): ?User {
132+ return $ this ->_em ->createQuery (
133+ 'SELECT u, g FROM ' .User::class . ' u
134+ LEFT JOIN FETCH u.groups g
135+ WHERE u.id = :id '
136+ )->setParameter ('id ' , $ id )->getOneOrNullResult ();
137+ }
130138}
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ public function getUserByUsername(string $username): ?User
389389 */
390390 public function getUserById (int $ id ): ?User
391391 {
392- return $ this ->user_repository ->getById ($ id );
392+ return $ this ->user_repository ->getByIdWithGroups ($ id );
393393 }
394394
395395 // Authentication
Original file line number Diff line number Diff line change @@ -43,4 +43,6 @@ public function getByIdentifier($user_identifier):?User;
4343 * @return User|null
4444 */
4545 public function getByVerificationEmailToken (string $ token ):?User ;
46+
47+ public function getByIdWithGroups (int $ id ): ?User ;
4648}
You can’t perform that action at this time.
0 commit comments