<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Zendcasts Forum / ZC41 – Doctrine Relations and Zend MVC]]></title>
		<link>http://www.zendcasts.com/forum/viewtopic.php?id=122</link>
		<description><![CDATA[The most recent posts in ZC41 – Doctrine Relations and Zend MVC.]]></description>
		<lastBuildDate>Tue, 07 Jun 2011 15:47:01 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: ZC41 – Doctrine Relations and Zend MVC]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=1451#p1451</link>
			<description><![CDATA[<p>Hi,</p><p>I followed this tutorial but still i have some questions, here is my example:</p><p>Yaml:<br />Core_Model_Language:<br />&#160; connection: default<br />&#160; tableName: core_language<br />&#160; columns:<br />&#160; &#160; id:<br />&#160; &#160; &#160; type: integer(4)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: true<br />&#160; &#160; &#160; autoincrement: true<br />&#160; &#160; name:<br />&#160; &#160; &#160; type: string(45)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; &#160; short:<br />&#160; &#160; &#160; type: string(45)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; &#160; active:<br />&#160; &#160; &#160; type: integer(1)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; relations:<br />&#160; &#160; News_Model_Noticias:<br />&#160; &#160; &#160; local: id<br />&#160; &#160; &#160; foreign: lang_id<br />&#160; &#160; &#160; type: many<br />News_Model_Noticias:<br />&#160; connection: default<br />&#160; tableName: news_noticias<br />&#160; columns:<br />&#160; &#160; id:<br />&#160; &#160; &#160; type: integer(4)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: true<br />&#160; &#160; &#160; autoincrement: true<br />&#160; &#160; titulo:<br />&#160; &#160; &#160; type: string(250)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; &#160; small:<br />&#160; &#160; &#160; type: string(400)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; &#160; full:<br />&#160; &#160; &#160; type: string()<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; &#160; data_creation:<br />&#160; &#160; &#160; type: timestamp(25)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: false<br />&#160; &#160; &#160; autoincrement: false<br />&#160; &#160; published:<br />&#160; &#160; &#160; type: integer(1)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; default: &#039;0&#039;<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; &#160; lang_id:<br />&#160; &#160; &#160; type: integer(4)<br />&#160; &#160; &#160; fixed: false<br />&#160; &#160; &#160; unsigned: false<br />&#160; &#160; &#160; primary: false<br />&#160; &#160; &#160; notnull: true<br />&#160; &#160; &#160; autoincrement: false<br />&#160; relations:<br />&#160; &#160; Core_Model_Language:<br />&#160; &#160; &#160; local: lang_id<br />&#160; &#160; &#160; foreign: id<br />&#160; &#160; &#160; type: one</p><p>Ok so i have this 2 tables (Models), i want to load all news and when presenting the list show the language name for that news item.</p><p>in my action i have: <br />public function indexAction()<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; $model = Doctrine::getTable(&#039;News_Model_Noticias&#039;);<br />&#160; &#160; &#160; &#160; $noticias = $model-&gt;findAll();<br />&#160; &#160; &#160; &#160; $this-&gt;view-&gt;noticias = $noticias;<br />&#160; &#160; }</p><p>Now if i vardump($this-&gt;noticias) on my view i get something like this:<br />array(1) {<br />&#160; [0] =&gt; array(7) {<br />&#160; &#160; [&quot;id&quot;] =&gt; string(1) &quot;4&quot;<br />&#160; &#160; [&quot;titulo&quot;] =&gt; string(5) &quot;teste&quot;<br />&#160; &#160; [&quot;small&quot;] =&gt; string(24) &quot;teste introdução noticia&quot;<br />&#160; &#160; [&quot;full&quot;] =&gt; string(18) &quot;Montes de conteudo&quot;<br />&#160; &#160; [&quot;data_creation&quot;] =&gt; string(19) &quot;0000-00-00 00:00:00&quot;<br />&#160; &#160; [&quot;published&quot;] =&gt; string(1) &quot;0&quot;<br />&#160; &#160; [&quot;lang_id&quot;] =&gt; string(1) &quot;1&quot;<br />&#160; }<br />}</p><p>Is there an easy way i can get the relation data automaticly? something like:<br />array(1) {<br />&#160; [0] =&gt; array(7) {<br />&#160; &#160; [&quot;id&quot;] =&gt; string(1) &quot;4&quot;<br />&#160; &#160; [&quot;titulo&quot;] =&gt; string(5) &quot;teste&quot;<br />&#160; &#160; [&quot;small&quot;] =&gt; string(24) &quot;teste introdução noticia&quot;<br />&#160; &#160; [&quot;full&quot;] =&gt; string(18) &quot;Montes de conteudo&quot;<br />&#160; &#160; [&quot;data_creation&quot;] =&gt; string(19) &quot;0000-00-00 00:00:00&quot;<br />&#160; &#160; [&quot;published&quot;] =&gt; string(1) &quot;0&quot;<br />&#160; &#160; [&quot;language&quot;] =&gt; array(4){<br />&#160; &#160; &#160; &#160; [&quot;id&quot;] =&gt; string(1) &quot;1&quot;<br />&#160; &#160; &#160; &#160; [&quot;name&quot;] =&gt; string(9) &quot;Português&quot;<br />&#160; &#160; &#160; &#160; [&quot;short&quot;] =&gt; string(5) &quot;pt_PT&quot;<br />&#160; &#160; &#160; &#160; [&quot;active&quot;] =&gt; string(1) &quot;1&quot;<br />&#160; &#160; }<br />&#160; }<br />} </p><p>If i vardump language model i get the news related to that language, but i wanna do it the other way around, fetch the news and have it grab the language object for each news item in an automated way, without having to write all the Joins by hand, since the languages table is related to pretty much all the other tables in my app.</p><p>Thanks in advance</p>]]></description>
			<author><![CDATA[dummy@example.com (miguelp)]]></author>
			<pubDate>Tue, 07 Jun 2011 15:47:01 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=1451#p1451</guid>
		</item>
		<item>
			<title><![CDATA[Re: ZC41 – Doctrine Relations and Zend MVC]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=534#p534</link>
			<description><![CDATA[<p>Awesome stuff! <br />Finaly a example of how to use the stuff we&#039;ve learned.:)</p><p>I see you don&#039;t use Zend Form. I guess its to make the example a little simpler. Is it much more difficult to use Zend Form than the way you did here? There must surely be some advantages with using Zend Form?</p>]]></description>
			<author><![CDATA[dummy@example.com (harri)]]></author>
			<pubDate>Wed, 30 Dec 2009 02:59:23 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=534#p534</guid>
		</item>
		<item>
			<title><![CDATA[ZC41 – Doctrine Relations and Zend MVC]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=533#p533</link>
			<description><![CDATA[<p>Happy Holidays everyone! </p><p>This short podcast covers how you can easily build a form using Zend&#039;s MVC model via Zend_Controller and using Doctrine for persistence. </p><p>You can <a href="http://zendcasts.googlecode.com/svn/trunk/zc41-doctrine-relations-and-zend-controllers/zc41-doctrine-relations-and-zend-controllers.zip">download the source code</a> or <a href="http://code.google.com/p/zendcasts/source/browse/#svn/trunk/zc41-doctrine-relations-and-zend-controllers">browse it online</a>. Enjoy!</p><p>zend_controller, mvc, doctrine, relations, orm</p>]]></description>
			<author><![CDATA[dummy@example.com (Jon Lebensold)]]></author>
			<pubDate>Tue, 29 Dec 2009 03:49:40 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=533#p533</guid>
		</item>
	</channel>
</rss>

