Skip to content

Loading…

DDC-3026: Provide DQL TYPE() function to access discriminator column value #3794

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

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.

@doctrinebot

Comment created by @ocramius:

I'd add that these should be 2 functions:

  • TYPE(e) gives you the class name for a given fetched result
  • DISCRIMINATOR(e) gives you the discriminator value for a given fetched result
@doctrinebot

Comment created by @beberlei:

Not an issue or something to add as a new feature. There is no way to get the discriminator value.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.