File tree Expand file tree Collapse file tree 2 files changed +3
-25
lines changed Expand file tree Collapse file tree 2 files changed +3
-25
lines changed Original file line number Diff line number Diff line change 1414namespace FOS \OAuthServerBundle \Entity ;
1515
1616use Doctrine \ORM \EntityManagerInterface ;
17- use Doctrine \ORM \EntityRepository ;
1817use FOS \OAuthServerBundle \Model \ClientInterface ;
1918use FOS \OAuthServerBundle \Model \ClientManager as BaseClientManager ;
2019
@@ -25,24 +24,14 @@ class ClientManager extends BaseClientManager
2524 */
2625 protected $ em ;
2726
28- /**
29- * @var EntityRepository
30- */
31- protected $ repository ;
32-
3327 /**
3428 * @var string
3529 */
3630 protected $ class ;
3731
3832 public function __construct (EntityManagerInterface $ em , $ class )
3933 {
40- // NOTE: bug in Doctrine, hinting EntityRepository|ObjectRepository when only EntityRepository is expected
41- /** @var EntityRepository $repository */
42- $ repository = $ em ->getRepository ($ class );
43-
4434 $ this ->em = $ em ;
45- $ this ->repository = $ repository ;
4635 $ this ->class = $ class ;
4736 }
4837
@@ -59,7 +48,7 @@ public function getClass()
5948 */
6049 public function findClientBy (array $ criteria )
6150 {
62- return $ this ->repository ->findOneBy ($ criteria );
51+ return $ this ->em -> getRepository ( $ this -> class ) ->findOneBy ($ criteria );
6352 }
6453
6554 /**
Original file line number Diff line number Diff line change 1414namespace FOS \OAuthServerBundle \Entity ;
1515
1616use Doctrine \ORM \EntityManagerInterface ;
17- use Doctrine \ORM \EntityRepository ;
1817use FOS \OAuthServerBundle \Model \TokenInterface ;
1918use FOS \OAuthServerBundle \Model \TokenManager as BaseTokenManager ;
2019
@@ -25,24 +24,14 @@ class TokenManager extends BaseTokenManager
2524 */
2625 protected $ em ;
2726
28- /**
29- * @var EntityRepository
30- */
31- protected $ repository ;
32-
3327 /**
3428 * @var string
3529 */
3630 protected $ class ;
3731
3832 public function __construct (EntityManagerInterface $ em , $ class )
3933 {
40- // NOTE: bug in Doctrine, hinting EntityRepository|ObjectRepository when only EntityRepository is expected
41- /** @var EntityRepository $repository */
42- $ repository = $ em ->getRepository ($ class );
43-
4434 $ this ->em = $ em ;
45- $ this ->repository = $ repository ;
4635 $ this ->class = $ class ;
4736 }
4837
@@ -59,7 +48,7 @@ public function getClass()
5948 */
6049 public function findTokenBy (array $ criteria )
6150 {
62- return $ this ->repository ->findOneBy ($ criteria );
51+ return $ this ->em -> getRepository ( $ this -> class ) ->findOneBy ($ criteria );
6352 }
6453
6554 /**
@@ -85,7 +74,7 @@ public function deleteToken(TokenInterface $token)
8574 */
8675 public function deleteExpired ()
8776 {
88- $ qb = $ this ->repository ->createQueryBuilder ('t ' );
77+ $ qb = $ this ->em -> getRepository ( $ this -> class ) ->createQueryBuilder ('t ' );
8978 $ qb
9079 ->delete ()
9180 ->where ('t.expiresAt < ?1 ' )
You can’t perform that action at this time.
0 commit comments