-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to add "INSTANCE OF" for Criteria Expression Comparison #113
Comments
Duplicate of doctrine/orm#5908 |
Thanks @Ocramius! Didn't know there was a request on the main doctrine2 project. |
As a note, I've found that if I use: $type1 = new Type\Type1();
$type2 = new Type\Type2();
Criteria::expr()->andWhere(
'field',
Criteria::expr()->in([$type1, $type2])
); Where |
Followup on my previous comment. My solution that did work for 1.4 doesn't work with 1.5 because the |
Switching to strict checking in doctrine#97 was a minor BC-break, which can be alleviated by doing it only for scalar values. As a consequence, 2 objects that are equal but not the same will pass the check. Fixes doctrine#113
I wanted to filter a collection by a specific type and ran into the same issue:
But If this is still a thing, then I could take a shot at this and try to add it to doctrine/collections and doctrine/orm |
I don't know how many other people are in need of it, but dealing with a a relational DB and the Doctrine Discriminator mapping is really handy. That is, until you need to limit the results from a Collection to a relation that has a relation of a particular discriminator type.
For example:
The actual need is more complex with multiple status types. It would be nice to be able to do the above with collections.
The text was updated successfully, but these errors were encountered: