Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-46

@AlsoLoad annotation causes exception when used together with Embed/Reference annotations

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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
      

        Activity

        Vladimir Razuvaev created issue -
        Jonathan H. Wage made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.0.0BETA1 [ 10080 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Vladimir Razuvaev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: