Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate FilterInterface::filter method #6515

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

VincentLanglet
Copy link
Member

@VincentLanglet VincentLanglet commented Oct 21, 2020

Subject

I am targeting this branch, because BC.

This method is not used in SonataAdmin so we don't have to require this signature in our Interface.

Persistence bundle are done this way:

abstract class Filter extends BaseFilter
{
    /**
     * @var bool
     */
    protected $active = false;

    public function apply($queryBuilder, $value)
    {
        $this->value = $value;
        if (\is_array($value) && \array_key_exists('value', $value)) {
            list($alias, $field) = $this->association($queryBuilder, $value);

            $this->filter($queryBuilder, $alias, $field, $value);
        }
    }

They just have to add

abstract function filter(...)

With specific signature. ($alias is only useful for ORM bundle for instance)

Closes #6269.

Changelog

### Deprecated
- Deprecate `FilterInterface::filter()` method

@VincentLanglet VincentLanglet merged commit d43224e into sonata-project:3.x Oct 21, 2020
@VincentLanglet VincentLanglet deleted the removeFilter branch October 21, 2020 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove alias parameter from FilterInterface::filter
3 participants