Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
DDC-1952: Add support for array parameters on the SQLFilter #2624
Jira issue originally created by user holtkamp:
The SQLFilter currently only accepts string parameters which would result in SQL like:
To filter an Entity that has a lifecycle, this can be usefull to filter Entities that are in a specific state, for example:
To be able to apply the filter on an Entity that can be in multiple states, it is usefull to be able to assign an array of states using setParameter:
to eventually result in:
However, this is currently not supported, it seems to go wrong on the PDO::quote() of the parameter. The SQL works ok when setting it statically in the filter, not taking the parameter into account.
It would be nice to have support for arrays on the setParameter()
Comment created by petr.pavel:
I've just created a pull request that implements just that. The only difference is that you don't call implode on the parameter when using it.
The usage would be: