Can I filter by Doctrine Discriminator Map column? #5459

Closed
opened 2026-01-22 15:08:14 +01:00 by admin · 2 comments
Owner

Originally created by @DavidGarciaCat on GitHub (Mar 14, 2017).

Originally assigned to: @Ocramius on GitHub.

Hello,

I am getting an error when I try to run a SELECT query WHEN the column used is the Doctrine Discriminator Map. I think this error is caused because my Entity has not a @ORM\Column annotation due the Discriminator Map is defined with the Entity instead of the properly.

Is there a way to run a SELECT adding a WHERE clause that is targeting a Discriminator Map column?

Thanks,

Originally created by @DavidGarciaCat on GitHub (Mar 14, 2017). Originally assigned to: @Ocramius on GitHub. Hello, I am getting an error when I try to run a `SELECT` query `WHEN` the column used is the `Doctrine Discriminator Map`. I think this error is caused because my `Entity` has not a `@ORM\Column` annotation due the Discriminator Map is defined with the `Entity` instead of the properly. Is there a way to run a `SELECT` adding a `WHERE` clause that is targeting a Discriminator Map column? Thanks,
admin added the Question label 2026-01-22 15:08:14 +01:00
admin closed this issue 2026-01-22 15:08:14 +01:00
Author
Owner

@Majkl578 commented on GitHub (Mar 14, 2017):

Yes, using the INSTANCE OF operator, see an example in documentation.
But this is an issue tracker to report bugs and so, not a forum to ask questions. 😕

@Majkl578 commented on GitHub (Mar 14, 2017): Yes, using the `INSTANCE OF` operator, see [an example in documentation](http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#dql-select-examples). But this is an issue tracker to report bugs and so, not a forum to ask questions. 😕
Author
Owner

@DavidGarciaCat commented on GitHub (Mar 14, 2017):

Hi @Majkl578 - Thanks for the quick response, and sorry for the inconvenience

@DavidGarciaCat commented on GitHub (Mar 14, 2017): Hi @Majkl578 - Thanks for the quick response, and sorry for the inconvenience
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5459