Skip to content

Conversation

@mechelon
Copy link
Member

No description provided.

…Filter into new namespace & adding valid filter operators
@mechelon
Copy link
Member Author

@johguentner What do you think about this approach for filters in general?

Usage:
$textFilter = Filter::textFilter("Name", "equals", "Ada Lovelace");

@johguentner
Copy link
Member

@johguentner What do you think about this approach for filters in general?

Usage:
$textFilter = Filter::textFilter("Name", "equals", "Ada Lovelace");

Love it !
What do you think about adding short textFilters as well, like "=" or ">=", or do you think, this would be confusing, since it's the same functionality ? 🤔
If I had to choose one, I'd actually stick with words like "equals", since it's more Notion-like 👌

@mechelon
Copy link
Member Author

Hmm, I would stick with the Notion terms (so equals instead of =). Maybe we can think about shorthands ::numberGreaterThan($value, $prop) or something later 🤔

I also added constants for the values in the Operators class for typo-safety. We should move them to an enum as soon as PHP 8.1 is widely distributed :)

@mechelon mechelon changed the base branch from main to dev September 25, 2021 12:57
@mechelon mechelon marked this pull request as ready for review September 25, 2021 19:57
@johguentner johguentner merged commit ae0d8a9 into dev Sep 25, 2021
@mechelon mechelon deleted the feature/more-filter-types branch June 17, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants