[PR #6574] #6573 multiple "NEW" operator syntax #10042

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

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

State: closed
Merged: No


In some cases, it will be good to use multiple NewObjectExpression.

For example, I used money library for money calculations and I would like to return the price of each item in my bucket as a Money value object.

            SELECT
                new Doctrine\Tests\Models\DDC6573\DDC6573Money(
                    i.priceAmount,
                    new Doctrine\Tests\Models\DDC6573\DDC6573Currency(i.priceCurrency)
                )
            FROM
                Doctrine\Tests\Models\DDC6573\DDC6573Item i

See: #6573

Right now I committed the only test.

**Original Pull Request:** https://github.com/doctrine/orm/pull/6574 **State:** closed **Merged:** No --- In some cases, it will be good to use multiple `NewObjectExpression`. For example, I used [money](https://github.com/moneyphp/money) library for money calculations and I would like to return the price of each item in my bucket as a `Money` value object. ``` SELECT new Doctrine\Tests\Models\DDC6573\DDC6573Money( i.priceAmount, new Doctrine\Tests\Models\DDC6573\DDC6573Currency(i.priceCurrency) ) FROM Doctrine\Tests\Models\DDC6573\DDC6573Item i ``` See: #6573 Right now I committed the only test.
admin added the pull-request label 2026-01-22 16:06:14 +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#10042