so as the title suggests, I need to add custom batch action to SonataUserBundle
.
With this action, the operator can send a message to all of the users (or selected ones). Therefore it needs to extend SonataAdminBundle
in order to be able to add a custom view for this action.
The problem is, ApplicationSonataUserBundle.php
is overriding SonataUserBundle
:
class ApplicationSonataUserBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'SonataUserBundle';
}
}
and if I change it, it will break the Bundle.
Is there any solutions that I can add this batch action to the bundle?
What you need is editing the sonata_user config to use you own Controller instead of the default Sonata Admin CRUD Controller.
So in your config.yml add the following:
And create your own controller that extend CRUDController
now you can add your own batch actions like this
Hope it will help someone :)