[MODM-46] @AlsoLoad annotation causes exception when used together with Embed/Reference annotations Created: 16/Aug/10  Updated: 17/Aug/10  Resolved: 17/Aug/10

Status: Resolved
Project: Doctrine MongoDB ODM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0BETA1

Type: Bug Priority: Major
Reporter: Vladimir Razuvaev Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None


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

Comment by Jonathan H. Wage [ 17/Aug/10 ]

Fixed by http://github.com/doctrine/mongodb-odm/commit/166ca49c13c8e3132b85383e4c55f0a09ce0d2b1

Generated at Wed Oct 07 12:03:36 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.