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

Implemented size, addSelect and memberOf DQL functions #163

Closed
yaffol opened this issue Sep 26, 2018 · 5 comments
Closed

Implemented size, addSelect and memberOf DQL functions #163

yaffol opened this issue Sep 26, 2018 · 5 comments
Labels

Comments

@yaffol
Copy link

yaffol commented Sep 26, 2018

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!

@yaffol
Copy link
Author

yaffol commented Oct 1, 2018

I realised that the easiest way to review this was as a pull request, probably! So I've submitted #164

@edefimov
Copy link
Contributor

edefimov commented Apr 4, 2019

The AddSelect feature is included in #156

@peter-gribanov
Copy link
Member

Now you can using select and addSelect in specification:

$spec = Spec::andX(
    Spec::select('field_name1'),
    Spec::addSelect('field_name2')
)

@peter-gribanov
Copy link
Member

Also you can use Doctrine functions in specification:

$spec = Spec::gt(Spec::SIZE('my_field'), 0);

@peter-gribanov
Copy link
Member

Solved by #172, #175 and #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants