Add filter in function inside EntityCrudController (Easyadmin 3.5.7 with Symfony 4.4.51)

101 views Asked by At

I'd like to check if filters are applied inside an Action function configured with configureActions() and, if not, I want to apply a filter (I have already filters classes programmed (with implements FilterInterface, all ok there).

But I cannot see a way to programmatically apply the filter...

I can obtain all filters with:

$filters = $this->get(FilterFactory::class)->create($context->getCrud()->getFiltersConfig(), $fields, $context->getEntity());

but I don't know what to do with it, and there's no ->applyFilter() that I can use on any object. Also I don't want to change the URL to apply the filter there because filters are complex queries already programmed in Admin/Filter and that seems like doing tricks to something that should be more direct, but I can't find the way even then.

0

There are 0 answers