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

        Flavio Lacerda created issue -
        Flavio Lacerda made changes -
        Field Original Value New Value
        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.

        Reards.

        PS: I'm using codeigniter framework
        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
        Jonathan H. Wage made changes -
        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
        When you try to find or execute query, filds with annotation reference many (arrays) do not load.

        Example:

        user.php
        {code}
        <?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();
        }
        ?>
        {code}

        group.php
        {code}
        <?php

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

        }
        ?>
        {code}

        When you execute this line:
        {code}
         $obj = $this->dm->findOne("User",("name" => "Flavio"));
        {code}

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

        When you use @EmbedMany annotation works file.

        Regards.

        PS: I'm using codeigniter framework
        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?
        Jonathan H. Wage made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        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.
        Flavio Lacerda made changes -
        Resolution Cannot Reproduce [ 5 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Flavio Lacerda made changes -
        Attachment test.zip [ 10724 ]
        Attachment output.png [ 10725 ]
        Flavio Lacerda made changes -
        Attachment screenshot-script.jpg [ 10726 ]
        Flavio Lacerda made changes -
        Attachment output.png [ 10725 ]
        Show
        Jonathan H. Wage added a comment - http://github.com/doctrine/mongodb-odm/commit/cbe22dfd50225250ab468ea2f5e243736b2f35fd
        Jonathan H. Wage made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 1.0.0BETA1 [ 10080 ]
        Resolution Fixed [ 1 ]
        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.

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=MODM-41, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: