[MODM-41] Hydration down not work for annotation "@ReferenceMany" Created: 06/Aug/10  Updated: 09/Aug/10  Resolved: 06/Aug/10

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

Type: Bug Priority: Major
Reporter: Flavio Lacerda Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows(webserver) / Unix (Mongo)


Attachments: JPEG File screenshot-script.jpg     Zip Archive test.zip    

 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



 Comments   
Comment by Jonathan H. Wage [ 06/Aug/10 ]

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

Comment by Flavio Lacerda [ 06/Aug/10 ]

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

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

http://github.com/doctrine/mongodb-odm/commit/cbe22dfd50225250ab468ea2f5e243736b2f35fd

Comment by Flavio Lacerda [ 09/Aug/10 ]

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

Generated at Thu Dec 25 18:33:51 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.