-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
Unique constraint (from DoctrineMongoDBBundle) doesn't work with embedded document #295
Comments
I have more details on this problem:
|
Cross-linking: doctrine/DoctrineMongoDBBundle#97 The validator itself looks fine. We likely just need to implement this method (and others if possible) to support the use case. |
I have a small question: does it make sense to have an "unique" constraint on an embedded document? |
I think it's possible to define a unique index on an embedded document, which should get picked up when the concrete document (corresponding to a collection) determines its indexes. In that sense, I think it's reasonable for embedded documents to also define unique constraints for those fields. |
The real problem is: we can't use the "unique" constraint on a field with an "association" (reference or embed). |
Issue looks still relevant early 2016. |
@davidloubere: as denoted by label status is "needs test" - please feel free to create a failing unit test and submit is a PR, this will speed up working on the issue |
According to my tests from #1363 |
Closing - if anyone can provide a failing test case, please do. |
I'm trying to use the "unique validator" from the DoctrineMongoDBBundle, but I get this error:
[BadMethodCallException] Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo::getAssociationTargetClass($assocName) is not implemented yet.
Am I doing something wrong?
I use Symfony 2.1, and latest bundles/projects versions.
The text was updated successfully, but these errors were encountered: