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

Make an 'or' and 'and' method in Laminas\Db\Sql\Predicate\Predicate? #246

Open
WillyBaldy opened this issue Jun 17, 2022 · 0 comments
Open

Comments

@WillyBaldy
Copy link

Feature Request

I'm not sure if this is really a feature request, but currently when building a query using Laminas\Db\Select we can do something like this:

$select->where->nest() // bracket opened
    ->isNull('column1')
    ->or
    ->equalTo('column1', '2')
    ->unnest();  // bracket closed
    ->equalTo('column2', '3');

There is no method we can call for "or", and PHPStorm doesn't like this by default. I don't like it either, I think in 2022 we're passed the era of magic methods. It would be amazing if methods "or" and "and" could be called instead, similar to how we can call "nest" and "unnest" methods.

Any thoughts?

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

No branches or pull requests

1 participant