I have a problem with deleting user with $UserManager->deleteUser($user). I'm getting an error: Error: Class AppBundle\Controller\UsermanagerController contains 35 abstract methods and must therefore be declared abstract or implement the remaining methods.
My Controller:
namespace AppBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use AppBundle\Entity\UserManager;
use FOS\UserBundle\Model\UserInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class UsermanagerController extends Controller implements UserInterface
{
public function deleteAction($user){
$UserManager = $this->container->get('fos_user.user_manager');
if ($user == null) {
throw new NotFoundHttpException('User not found for user ' . $user);
}
$UserManager->deleteUser($user);
return $this->redirect($this->generateUrl('admin_index'));
}
My Entity:
namespace AppBundle/Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Doctrine\UserManager as BaseCustomer;
use FOS\UserBundle\Model\UserInterface;
/**
*@ORM|Entitiy
*
*/
class UserManager extends BaseCustomer implements UserInterface
{
}
My config.yml: orm:
resolve_target_entities:
FOS\UserBundle\Model\UserInterface: AppBundle\Entity\UserManager
And Routing.yml:
fos_deleteuser_group:
path: /app/usermanager/delete/{user}
defaults: { _controller: AppBundle:Usermanager:delete }
I tried to use FOS/UserBundle/doctrine/UserManager, no luck.
Thanks for your help in advance.