I want to know how to override an EasyAdminBundle controller. Actually, I want to write some custom query from the database and I don't want to use dqlFilter.
Following is my config.yml file.
easy_admin:
site_name: 'site mame .'
entities:
User:
class: EmployeeBundle\Entity\EmployeeLogin
controller: EmployeeBundle\Controller\UserController
form:
fields: ['id', {property : 'userName', label : 'Users'}, {property: 'status', type:'choice', type_options: {choices: {'Active':'1', 'Deactive':'0'}}}]
new:
title: 'Add Login'
form_options: { validation_groups: ['Default', 'EmployeeLogin'] }
fields: ['-id']
edit:
title: 'Edit Login Details'
form_options: { validation_groups: ['Default'] }
label: 'Employees'
list:
title: "%%entity_label%% customers"
help: 'The list view overrides the global help message'
fields: ['id', {property : 'userName', label : 'Users'}, {property: 'status', type: 'boolean'}, {property : 'lastLogin',format: 'D j-n-Y, h:i:s'}]
And this is my UserController where I extend BaseAdminController please let me know how can I customize the query from repository or within a Controller
namespace EmployeeBundle\Controller;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController;
use Symfony\Component\HttpFoundation\Request;
class UserController extends BaseAdminController
{
public function listUserAction()
{
}
}
I did this and it worked hope it will be helpful someone else: