Symfony2 Fatal error in Users Entity Provider
I'm using symfony 2.3.4 and in security configuration I want to to load Security Users from the Database accordingly to this Cookbook instruction. But I only get this error:
Fatal error: Class MyAppAdminBundleEntityUsers contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (SymfonyComponentSecurityCoreUserUserInterface::getRoles, SymfonyComponentSecurityCoreUserUserInterface::getUsername, SymfonyComponentSecurityCoreUserUserInterface::eraseCredentials) in /Volumes/Htdocs/symfony/src/MyApp/AdminBundle/Entity/Users.php
Symfony's security framework expects the User entity to implement the UserInterface
. Implement the three methods:
public function getRoles()
public function getUsername()
public function eraseCredentials()
Just implement the methods from the interface. ;)
链接地址: http://www.djcxy.com/p/69380.html