Closed franmomu closed 3 years ago
@franmomu I think the filter
method should be removed from the interface.
The filter
method is used by the apply
one
https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/blob/3.x/src/Filter/Filter.php#L22
https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/3.x/src/Filter/Filter.php#L27
The abstract class Filter of the persistence bundle should just have an abstract protected filter()
method instead.
@franmomu I think the
filter
method should be removed from the interface.The
filter
method is used by theapply
one https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/blob/3.x/src/Filter/Filter.php#L22 https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/3.x/src/Filter/Filter.php#L27The abstract class Filter of the persistence bundle should just have an
abstract protected filter()
method instead.
Interesting, that would be easier than deprecate the second argument which I had no idea how to do it.
Feature Request
Right now
Sonata\AdminBundle\Filter\FilterInterface::filter()
is declared like:The
$alias
parameter is specific to the ORM implementation, we should removed it to make it agnostic from the persistence layer.To solve this in SonataDoctrineORMAdminBundle, we can probably use
QueryBuilder::getRootAlias()
method.Also remove from
ModelManagerInterface::createQuery($class, $alias = 'o')