<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 02:06:01 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/MODM-144/MODM-144.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[MODM-144] Bi-Directional References Feature</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-144</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I cant&#180;t reproduce the Bi-Directional References with my own example or the example of the documentation.&lt;br/&gt;
Perhaps the documentation is not up to date or their ist a bug.&lt;/p&gt;

&lt;p&gt;BlogPost.php&lt;br/&gt;
&amp;lt;?php&lt;/p&gt;

&lt;p&gt;/** @Document */&lt;br/&gt;
class BlogPost&lt;br/&gt;
{&lt;br/&gt;
    /** @Id */&lt;br/&gt;
    public $id;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $title;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $content;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $createtime;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $updatetime;&lt;/p&gt;

&lt;p&gt;    /** @ReferenceMany(targetDocument=&quot;PostComment&quot;, mappedBy=&quot;post&quot;) */&lt;br/&gt;
    private $comments;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;PostComment.php&lt;br/&gt;
&amp;lt;?php&lt;/p&gt;

&lt;p&gt;/** @Document */&lt;br/&gt;
class PostComment&lt;br/&gt;
{&lt;br/&gt;
    /** @Id */&lt;br/&gt;
    public $id;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $name;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $mail;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $content;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $createtime;&lt;/p&gt;

&lt;p&gt;    /** @String */&lt;br/&gt;
    public $updatetime;&lt;/p&gt;

&lt;p&gt;    /** @ReferenceOne(targetDocument=&quot;BlogPost&quot;, inversedBy=&quot;comments&quot;) */&lt;br/&gt;
    private $post;&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;CommentController.php&lt;br/&gt;
        // Save the Post&lt;br/&gt;
        $post = new BlogPost();&lt;br/&gt;
        $post-&amp;gt;setTitle = &apos;testtitle&apos;;&lt;br/&gt;
        //$post-&amp;gt;content = &apos;testcontent&apos;;&lt;br/&gt;
        //$post-&amp;gt;createdate = time();&lt;/p&gt;

&lt;p&gt;        $comment1 = new PostComment();&lt;br/&gt;
        $comment1-&amp;gt;title = &apos;testcommenttitle1&apos;;&lt;/p&gt;

&lt;p&gt;        $comment2 = new PostComment();&lt;br/&gt;
        $comment2-&amp;gt;title = &apos;testcommenttitle2&apos;;&lt;/p&gt;

&lt;p&gt;        $comment3 = new PostComment();&lt;br/&gt;
        $comment3-&amp;gt;title = &apos;testcommenttitle3&apos;;&lt;/p&gt;

&lt;p&gt;        $dm-&amp;gt;persist($comment1);&lt;br/&gt;
        $dm-&amp;gt;persist($comment2);&lt;br/&gt;
        $dm-&amp;gt;persist($comment3);&lt;br/&gt;
        $dm-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;        echo $post-&amp;gt;id;&lt;/p&gt;

&lt;p&gt;        /*$posts = $dm-&amp;gt;createQueryBuilder(&apos;BlogPost&apos;)&lt;br/&gt;
                        -&amp;gt;getQuery();*/&lt;/p&gt;

&lt;p&gt;        $post = $dm-&amp;gt;getRepository(&apos;BlogPost&apos;)-&amp;gt;find(&apos;4dd45739f563724c23000002&apos;);&lt;/p&gt;

&lt;p&gt;        Zend_Debug::dump($post);&lt;br/&gt;
        $comments = $post-&amp;gt;getComments();&lt;/p&gt;

&lt;p&gt;------------------------&lt;br/&gt;
In the documentation the example is&lt;br/&gt;
$post1-&amp;gt;setUser($user);&lt;br/&gt;
But the only working for me is:&lt;br/&gt;
$post-&amp;gt;setTitle = &apos;testtitle&apos;;&lt;/p&gt;

&lt;p&gt;Anyway, I can&#180;t get the Comments from the mongodb.&lt;br/&gt;
I always get this error.&lt;br/&gt;
Fatal error: Call to undefined method BlogPost::getComments()&lt;br/&gt;
This is a correct error message because BlogPost really dont have a getComments()&lt;br/&gt;
method. How do I get my Comments then?&lt;br/&gt;
Any help would be great.&lt;/p&gt;

&lt;p&gt;Greetings tronga&lt;/p&gt;</description>
                <environment>Zend Framework 1.11.6</environment>
            <key id="12647">MODM-144</key>
            <summary>Bi-Directional References Feature</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tronga">Jan Gantzert</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 May 2011 23:49:19 +0000</created>
                <updated>Wed, 18 May 2011 23:49:19 +0000</updated>
                                    <version>1.0.0BETA3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>