<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Doctrine Many To Many With Extra Fields</title>
	<atom:link href="http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/</link>
	<description>Design &#38; Development Blog</description>
	<lastBuildDate>Wed, 09 May 2012 11:54:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: amado</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-9522</link>
		<dc:creator>amado</dc:creator>
		<pubDate>Tue, 18 Jan 2011 12:52:14 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-9522</guid>
		<description>I spent like 3 hours setting up the relations.. then I read your page and it hit me: The relations must be PROPERLY set up in BOTH of your Many-TO-Many Classes.. Not just your &#039;connecting&#039; class.</description>
		<content:encoded><![CDATA[<p>I spent like 3 hours setting up the relations.. then I read your page and it hit me: The relations must be PROPERLY set up in BOTH of your Many-TO-Many Classes.. Not just your &#8216;connecting&#8217; class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-9060</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Fri, 17 Dec 2010 09:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-9060</guid>
		<description>great post, thanks for sharing</description>
		<content:encoded><![CDATA[<p>great post, thanks for sharing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fem!</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-8036</link>
		<dc:creator>fem!</dc:creator>
		<pubDate>Wed, 08 Sep 2010 16:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-8036</guid>
		<description>Sorry for previous comment.
@Prasad Gupte
Text:
  Text1:
     title: ‘text1&#039;
  Text2:
     title: &#039;text2&#039;
Author:
   Author1:
     name: &#039;a1&#039;
  Author2:
     name: &#039;a2&#039;
TextAuthor:
   TextAuthor1:
       author_id: Author1
       text_id: Text1
    TextAuthor2:
       author_id: Author2
       text_id: Text1</description>
		<content:encoded><![CDATA[<p>Sorry for previous comment.<br />
@Prasad Gupte<br />
Text:<br />
  Text1:<br />
     title: ‘text1&#8242;<br />
  Text2:<br />
     title: &#8216;text2&#8242;<br />
Author:<br />
   Author1:<br />
     name: &#8216;a1&#8242;<br />
  Author2:<br />
     name: &#8216;a2&#8242;<br />
TextAuthor:<br />
   TextAuthor1:<br />
       author_id: Author1<br />
       text_id: Text1<br />
    TextAuthor2:<br />
       author_id: Author2<br />
       text_id: Text1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fem!</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-8035</link>
		<dc:creator>fem!</dc:creator>
		<pubDate>Wed, 08 Sep 2010 16:50:14 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-8035</guid>
		<description>@Prasad Gupte
Text:
    Text1:
    title: &#039;t
Author</description>
		<content:encoded><![CDATA[<p>@Prasad Gupte<br />
Text:<br />
    Text1:<br />
    title: &#8216;t<br />
Author</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prasad Gupte</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-7869</link>
		<dc:creator>Prasad Gupte</dc:creator>
		<pubDate>Mon, 19 Jul 2010 04:56:33 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-7869</guid>
		<description>Do you how to define the fixture when the mapping (m:m) table has an extra field?</description>
		<content:encoded><![CDATA[<p>Do you how to define the fixture when the mapping (m:m) table has an extra field?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joanna</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-7426</link>
		<dc:creator>Joanna</dc:creator>
		<pubDate>Tue, 27 Apr 2010 17:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-7426</guid>
		<description>$q = Doctrine_Query::create()
  		-&gt;from(&#039;Model_Db_Websites w&#039;)
  		-&gt;leftJoin(&#039;w.WebsiteMedia wm&#039;)
    	-&gt;leftJoin(&#039;wm.Media m&#039;)
		-&gt;orderBy(&#039;wm.ordering ASC&#039;)
	;
That&#039;s the query above.

Inside WebsitesBase setUp():

$this-&gt;hasMany(&#039;Model_Db_WebsiteMedia as WebsiteMedia&#039;, array(
             &#039;local&#039; =&gt; &#039;id&#039;,
             &#039;foreign&#039; =&gt; &#039;websites_id&#039;));

WebsiteMedia setUp() function:

	$this-&gt;hasOne(&#039;Model_Db_Media as Media&#039;, array(
         &#039;local&#039; =&gt; &#039;media_id&#039;,
         &#039;foreign&#039; =&gt; &#039;id&#039;));

    $this-&gt;hasOne(&#039;Model_Db_Websites as Websites&#039;, array(
         &#039;local&#039; =&gt; &#039;websites_id&#039;,
         &#039;foreign&#039; =&gt; &#039;id&#039;));</description>
		<content:encoded><![CDATA[<p>$q = Doctrine_Query::create()<br />
  		->from(&#8216;Model_Db_Websites w&#8217;)<br />
  		->leftJoin(&#8216;w.WebsiteMedia wm&#8217;)<br />
    	->leftJoin(&#8216;wm.Media m&#8217;)<br />
		->orderBy(&#8216;wm.ordering ASC&#8217;)<br />
	;<br />
That&#8217;s the query above.</p>
<p>Inside WebsitesBase setUp():</p>
<p>$this->hasMany(&#8216;Model_Db_WebsiteMedia as WebsiteMedia&#8217;, array(<br />
             &#8216;local&#8217; => &#8216;id&#8217;,<br />
             &#8216;foreign&#8217; => &#8216;websites_id&#8217;));</p>
<p>WebsiteMedia setUp() function:</p>
<p>	$this->hasOne(&#8216;Model_Db_Media as Media&#8217;, array(<br />
         &#8216;local&#8217; => &#8216;media_id&#8217;,<br />
         &#8216;foreign&#8217; => &#8216;id&#8217;));</p>
<p>    $this->hasOne(&#8216;Model_Db_Websites as Websites&#8217;, array(<br />
         &#8216;local&#8217; => &#8216;websites_id&#8217;,<br />
         &#8216;foreign&#8217; => &#8216;id&#8217;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Tourlourat</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-7424</link>
		<dc:creator>Thomas Tourlourat</dc:creator>
		<pubDate>Tue, 27 Apr 2010 13:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-7424</guid>
		<description>Okay, I have not see the DQL correctly.

Two point are confused to me.
The first, I want to select only some properties. But the select () isn&#039;t working when I&#039;m using the link-table like this; 

The second point is that you use a relation &quot;WebsiteMedia&quot; that isn&#039;t define in the WebsiteBase::setUp () function.

An optional point is, that the 
orderBy (&quot;wm.ordring ASC&quot;); doesn&#039;t change the result order. Why..</description>
		<content:encoded><![CDATA[<p>Okay, I have not see the DQL correctly.</p>
<p>Two point are confused to me.<br />
The first, I want to select only some properties. But the select () isn&#8217;t working when I&#8217;m using the link-table like this; </p>
<p>The second point is that you use a relation &#8220;WebsiteMedia&#8221; that isn&#8217;t define in the WebsiteBase::setUp () function.</p>
<p>An optional point is, that the<br />
orderBy (&#8220;wm.ordring ASC&#8221;); doesn&#8217;t change the result order. Why..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jo</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-7423</link>
		<dc:creator>Jo</dc:creator>
		<pubDate>Tue, 27 Apr 2010 09:10:12 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-7423</guid>
		<description>Not sure if that&#039;s what you are asking, but as you are explicitly using WebsiteMedia (with the alias wm) you should be able to access the properties as say wm.ordering or wm.caption.

Don&#039;t have the code at hand to check but I migth do a proper post about it later :)</description>
		<content:encoded><![CDATA[<p>Not sure if that&#8217;s what you are asking, but as you are explicitly using WebsiteMedia (with the alias wm) you should be able to access the properties as say wm.ordering or wm.caption.</p>
<p>Don&#8217;t have the code at hand to check but I migth do a proper post about it later <img src='http://think-robot.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Tourlourat</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-7422</link>
		<dc:creator>Thomas Tourlourat</dc:creator>
		<pubDate>Tue, 27 Apr 2010 08:59:39 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-7422</guid>
		<description>Hi there,
Thank for this article.

I want to ask you just one question,
You have a many-to-many relationships between Media and Website.
The link-table have some property like &quot;ordering&quot;, &quot;caption&quot;...
The question is : &quot;How do you proceed to order your result when you use the leftJoin on WebsiteMedia&quot;.
Otherwise, How do you proceed to access on the properties of the link-table with DQL.

Thank,
Armetiz.</description>
		<content:encoded><![CDATA[<p>Hi there,<br />
Thank for this article.</p>
<p>I want to ask you just one question,<br />
You have a many-to-many relationships between Media and Website.<br />
The link-table have some property like &#8220;ordering&#8221;, &#8220;caption&#8221;&#8230;<br />
The question is : &#8220;How do you proceed to order your result when you use the leftJoin on WebsiteMedia&#8221;.<br />
Otherwise, How do you proceed to access on the properties of the link-table with DQL.</p>
<p>Thank,<br />
Armetiz.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VanSanblch</title>
		<link>http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/comment-page-1/#comment-7415</link>
		<dc:creator>VanSanblch</dc:creator>
		<pubDate>Mon, 26 Apr 2010 12:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://think-robot.com/?p=180#comment-7415</guid>
		<description>And what fixture file do you use for ts_website_has_media table?</description>
		<content:encoded><![CDATA[<p>And what fixture file do you use for ts_website_has_media table?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

