Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 09d0924

Browse filesBrowse files
Hugo Hamonweaverryan
authored andcommitted
updated UserRepository::supportsClass() method according to @stof advises.
1 parent 5a2824b commit 09d0924
Copy full SHA for 09d0924

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎cookbook/security/entity_provider.rst

Copy file name to clipboardExpand all lines: cookbook/security/entity_provider.rst
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ The code below shows the implementation of the
319319
320320
class UserRepository extends EntityRepository implements UserProviderInterface
321321
{
322+
const ENTITY_CLASS = 'Acme\Bundle\UserBundle\Entity\User';
323+
322324
public function loadUserByUsername($username)
323325
{
324326
$q = $this
@@ -355,7 +357,7 @@ The code below shows the implementation of the
355357
356358
public function supportsClass($class)
357359
{
358-
return is_subclass_of($class, 'Acme\Bundle\UserBundle\Entity\User');
360+
return self::ENTITY_CLASS === $class || is_subclass_of($class, self::ENTITY_CLASS);
359361
}
360362
}
361363

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.