mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Problem with INSTANCE OF and array parameter #5021
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Feb 25, 2016).
I don't know whether this is me misunderstanding something but if I use an array parameter with INSTANCE OF I have to pass an array of discriminators for the query to work.
The following works:
But this example doesn't, it runs, but inserts the class names into the SQL rather than the discriminator:
I'd expect the second one to work because if you supply a single parameter it should be a ClassMetadata instance.
@Ocramius commented on GitHub (Feb 25, 2016):
INSTANCE OFaccepts only one parameter value. If you need multiple checks, use theORoperator@ghost commented on GitHub (Feb 25, 2016):
Ok that's great. I was just confused by this http://stackoverflow.com/questions/7504680/doctrine-2-how-to-write-a-dql-select-statement-to-search-some-but-not-all-the which seems to suggest it is possible.