possible to skip adding field to entity? #4987

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

Originally created by @ghost on GitHub (Jan 21, 2016).

Originally assigned to: @Ocramius on GitHub.

I have a one to many relationship. On the many side of the table, there's a field that's not implemented in the actual entity. I would like to skip adding the field to the entity, and do a lookup on in via raw sql.

example:
customer => order
one => many

Is this possible with query builder?

        $qb->leftJoin('Orders', 'oso', 'WITH', 'oso.order = c.id');


        $qb->andWhere('oso.some_field IN (:customerOrders')
            ->setParameter('some_field', [1,2,3] );
Originally created by @ghost on GitHub (Jan 21, 2016). Originally assigned to: @Ocramius on GitHub. I have a one to many relationship. On the many side of the table, there's a field that's not implemented in the actual entity. I would like to skip adding the field to the entity, and do a lookup on in via raw sql. example: customer => order one => many Is this possible with query builder? ``` php $qb->leftJoin('Orders', 'oso', 'WITH', 'oso.order = c.id'); $qb->andWhere('oso.some_field IN (:customerOrders') ->setParameter('some_field', [1,2,3] ); ```
admin added the Invalid label 2026-01-22 14:55:41 +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#4987