laminas/laminas-db

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

WillyBaldy opened this issue · 0 comments

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?