Closed Chris53897 closed 1 year ago
Stale pull request message
Waiting for reponse from @curry684 It would be great at least to have the IN-Operator in the main repo. I do not know if the enum Case is generic enough for you.
Sorry I don't habitually look into draft PRs, and it's complicated to review lots of changes in one.
IN
is needed as IN
is similar to other expressions with a left/right expr. Fully supported by Doctrine's comparisons as well: https://www.doctrine-project.org/projects/doctrine-collections/en/stable/expressions.htmlIN
should not be used for freetext filtering. If the target data is discrete as with an enum the filter should be a dropdown, and then you can just use =
for comparison again.EnumColumn
then, as enums support __toString
and are therefore fully compatible with TextColumn, TwigColumn et al. The use of pseudointerfaces (defining a function that should be implemented on the enum) is not something I support.Thanks for your review.
1) I do not know how to rewrite the IN-Expression for Enums. But as this will no be added, i will use my fork. 2) Additional i added Dropdown for Filtering. Search would have been some nice addon. 3) The reason behind the additional function name, is that we have multiple Text-Representations of our enums (short, long, html)
I will close this
My goal is to have a searchable enums. The enum has a
label()
function to get the searchable (display) name. You can search for "Männ" and it filters the dataset correct. Find search-Values in Enum::labels() or names of an enum and configure the search-query accordingly.For this reason i need the
IN
Operator, that is not yet possible, if i see this correct. There are more possible implementation. I want to know how you want this to be handled.searchIn
an Expression ($queryBuilder->expr())?Tests will be added after idea is general approved.
Example Enum:
`Enum GenderType: string { case MALE = 'M'; case FEMALE = 'F';
Ideas for improvement:
label()
WDYT?