Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0.0BETA1
-
Component/s: None
-
Labels:None
Description
Imagine that there is following object in DB:
{
"_id": "4c6936bf0f9d50300d000000",
"c": {
"tmp": "tmp"
}
}
And I want to rename property "c" to "b" in my class, using @AlsoLoad together with @EmbedOne
/** @Document(db="tests", collection="tests") */ class a { /** @Id */ protected $id; /** * @EmbedOne(targetDocument="b") * @AlsoLoad("c") */ protected $b; } /** @EmbeddedDocument */ class b { protected $tmp = 'tmp'; } $a = $dm->loadByID('a', '4c6936bf0f9d50300d000000'); // will throw an exception: Property "b" in "a" was already declared, but it must be declared only once
Fixed by http://github.com/doctrine/mongodb-odm/commit/166ca49c13c8e3132b85383e4c55f0a09ce0d2b1