DTO/SELECT NEW Support for non-scalars #6637

Open
opened 2026-01-22 15:36:15 +01:00 by admin · 0 comments
Owner

Originally created by @Warxcell on GitHub (Feb 23, 2021).

Is there any plan for supporting SELECT NEW having relations and entities ?

This will be very useful for calculated fields, unidirection relation and entities that are not connected with relation at all.

For example SELECT NEW DTO(entity, SUM(calculatedField1)) FROM Entity entity GROUP by entity.id

and the DTO

class DTO {
   public function __construct(Entity $entity, int $field1)
}
Originally created by @Warxcell on GitHub (Feb 23, 2021). Is there any plan for supporting `SELECT NEW` having relations and entities ? This will be very useful for calculated fields, unidirection relation and entities that are not connected with relation at all. For example `SELECT NEW DTO(entity, SUM(calculatedField1)) FROM Entity entity GROUP by entity.id` and the DTO ```php class DTO { public function __construct(Entity $entity, int $field1) } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6637