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

上一篇: Doctrine2重复来自trait的属性和方法

下一篇: Symfony2用户实体提供程序中的致命错误