-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implemented size, addSelect and memberOf DQL functions #163
Labels
Comments
I realised that the easiest way to review this was as a pull request, probably! So I've submitted #164 |
The |
Now you can using $spec = Spec::andX(
Spec::select('field_name1'),
Spec::addSelect('field_name2')
) |
Also you can use Doctrine functions in specification: $spec = Spec::gt(Spec::SIZE('my_field'), 0); |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, this is a great project - thanks for all the hard work in making it!
I'm using it in production, and found a need to add support for DQL member of, size and addSelect functions. So I forked and implemented those.
Before submitting a PR I wanted to check that these are features of interest, and that the way they've been implemented is OK.
The comparison order (left/right operator) is effectively flipped for a member of comparison (generating 'value MEMBER OF dqlalias.field' rather than for example 'dqlalias.field LIKE value'). I've implemented the check for this in a slightly hacky way within the Filter/Comparison class. I'd be open to suggestions as to how to do it better, but didn't want to refactor the base Comparison class without reaching out first.
Again, thanks for this great project, and hopefully these features may be of use to some other people - they are certainly making my life easier!
The text was updated successfully, but these errors were encountered: