Skip to content

Add _or to filters - #319

Merged
TomHAnderson merged 1 commit into
API-Skeletons:14.1.xfrom
TomHAnderson:feature/or-filters
Oct 5, 2026
Merged

TomHAnderson merged 1 commit into
API-Skeletons:14.1.xfrom
TomHAnderson:feature/or-filters

Conversation

@TomHAnderson

Copy link
Copy Markdown
Member

A filter's or is a list of branches, any of which a row matches. Each branch is a filter whose own filters are all matched, of a FilterBranch type: the same filters less sort and sortPriority, with an _or of its own. Collection filters and computed fields, with their args, have it too.

  • Filter\QueryBuilder's filter methods return their conditions rather than adding them; apply() adds the top-level conditions one by one, so a filter without _or builds the same DQL. A branch with no conditions is 1 = 1, keeping the parameters other branches bound; _or: [] matches nothing, as in: [] does.
  • The filterDepth (default 3) and filterConditions (default 100) config limit _or before any DQL is built, with a client error. Only conditions inside _or are counted; 0 or null is unlimited.
  • A field, alias or computed field named _or throws Exception\Metadata.
  • A field given null, such as { name: null }, raised a PHP warning; it is not applied, as a filter given null is not.

A filter's _or is a list of branches, any of which a row matches.  Each
branch is a filter whose own filters are all matched, of a
FilterBranch_<Type> type: the same filters less sort and sortPriority,
with an _or of its own.  Collection filters and computed fields, with
their args, have it too.

- Filter\QueryBuilder's filter methods return their conditions rather
  than adding them; apply() adds the top-level conditions one by one, so
  a filter without _or builds the same DQL.  A branch with no conditions
  is 1 = 1, keeping the parameters other branches bound; _or: [] matches
  nothing, as in: [] does.
- The filterDepth (default 3) and filterConditions (default 100) config
  limit _or before any DQL is built, with a client error.  Only
  conditions inside _or are counted; 0 or null is unlimited.
- A field, alias or computed field named _or throws Exception\Metadata.
- A field given null, such as { name: null }, raised a PHP warning; it
  is not applied, as a filter given null is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3208415) to head (b55caff).
⚠️ Report is 3 commits behind head on 14.1.x.

Additional details and impacted files
@@             Coverage Diff              @@
##              14.1.x      #319    +/-   ##
============================================
  Coverage     100.00%   100.00%            
- Complexity      1276      1318    +42     
============================================
  Files             81        81            
  Lines           3490      3597   +107     
============================================
+ Hits            3490      3597   +107     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TomHAnderson
TomHAnderson merged commit 4f72bd9 into API-Skeletons:14.1.x Oct 5, 2026
16 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant