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

Hydration down not work for annotation "@ReferenceMany"

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0ALPHA2
    • Fix Version/s: 1.0.0BETA1
    • Component/s: Hydration
    • Labels:
      None
    • Environment:
      Windows(webserver) / Unix (Mongo)

      Description

      When you try to find or execute query, filds with annotation reference many (arrays) do not load.

      Example:

      user.php

      <?php
      
      /**
       * @Document(db="DB", collection="Users")
       */
      class User
      {
          /**
           * @Id
           */
          public $id;
          /**
           * @String
           */
          public $name;
          /**
           * @String
           */
          public $password;
          /**
           * @String
           */
          public $email;
              /**
           * @ReferenceMany(targetDocument="Group")
           */
          public $groups = array();
      }
      ?>
      

      group.php

      <?php
      
      /**
       * @Document(db="MCI", collection="Groups")
       */
      class Group
      {
          /**
           * @Id
           */
          public $id;
          /**
           * @String
           */
          public $name;
          /**
           * @String
           */
          public $role_name;
      
      }
      ?>
      

      When you execute this line:

       $obj = $this->dm->findOne("User",("name" => "Flavio"));
      

      All the fields are returned correctly, but "groups" apear empty.

      When you use @EmbedMany annotation works file.

      Regards.

      PS: I'm using codeigniter framework

        Activity

        Hide
        Jonathan H. Wage added a comment -

        This works for me. Can you provide a more exact test case that does not work?

        Show
        Jonathan H. Wage added a comment - This works for me. Can you provide a more exact test case that does not work?
        Hide
        Flavio Lacerda added a comment -

        I created an script.
        Took a picture of output script too.

        Show
        Flavio Lacerda added a comment - I created an script. Took a picture of output script too.
        Show
        Jonathan H. Wage added a comment - http://github.com/doctrine/mongodb-odm/commit/cbe22dfd50225250ab468ea2f5e243736b2f35fd
        Hide
        Flavio Lacerda added a comment -

        Now works perfect. I´m using it a lot. Amazing lib and amazing support.

        Show
        Flavio Lacerda added a comment - Now works perfect. I´m using it a lot. Amazing lib and amazing support.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: