Jira issue originally created by user naderman:
It is not currently possible to figure out which type a value is associated with if you do not wish to perform object hydrations. There should be a TYPE() function in DQL which returns the value of the discriminator column or the associated class name, e.g SELECT u.id, TYPE(u) FROM Some\Base\Class u which would return [[1, 'foo'], [2, 'bar']] if there were two classes foo and bar which inherit from the base class.
SELECT u.id, TYPE(u) FROM Some\Base\Class u
[[1, 'foo'], [2, 'bar']]
Comment created by @ocramius:
I'd add that these should be 2 functions:
Comment created by @beberlei:
Not an issue or something to add as a new feature. There is no way to get the discriminator value.
Issue was closed with resolution "Fixed"