Skip to content

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

Description

@WillyBaldy

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions