[PR #10530] Add handling of 'not' composite expression in QueryExpressionVisitor #12435

Closed
opened 2026-01-22 16:14:02 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/10530

State: closed
Merged: No


Add handling of NOT composite expression in QueryExpressionVisitor::walkCompositeExpression like in Expr::not.

Before, if you ran the following criteria it gave the error Unknown composite NOT:

new Criteria(
    new CompositeExpression(
        CompositeExpression::TYPE_NOT,
        [new Comparison('id', Comparison::EQ, '1')]
    )
);

With the introduced changes, a handler for the NOT expression is found and the query is constructed correctly:

SELECT * FROM Entity u0_ WHERE NOT (u0_.id = ?)
**Original Pull Request:** https://github.com/doctrine/orm/pull/10530 **State:** closed **Merged:** No --- Add handling of ```NOT``` composite expression in ```QueryExpressionVisitor::walkCompositeExpression``` like in ```Expr::not```. Before, if you ran the following criteria it gave the error ```Unknown composite NOT```: ```php new Criteria( new CompositeExpression( CompositeExpression::TYPE_NOT, [new Comparison('id', Comparison::EQ, '1')] ) ); ``` With the introduced changes, a handler for the ```NOT``` expression is found and the query is constructed correctly: ```sql SELECT * FROM Entity u0_ WHERE NOT (u0_.id = ?) ```
admin added the pull-request label 2026-01-22 16:14:02 +01:00
admin closed this issue 2026-01-22 16:14:02 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#12435