<?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: CodeIgniter and Doctrine from scratch Day 6 – Models with Relationships</title>
	<atom:link href="http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships</link>
	<description>PHP, JS, CSS, jQuery, CodeIgniter, Doctrine</description>
	<lastBuildDate>Sat, 04 Sep 2010 17:13:31 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-14683</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sat, 04 Sep 2010 17:13:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-14683</guid>
		<description>Hi there,
first of all thanks for this great tutorial!
I am having a little trouble with something though... I want to delete a table that I created following this tutorial, because I want to change some parameters in setTableDefinition (stuff like null, notnull, unique, etc.).
But when I try to drop the table I get this error message from PhpMyAdmin:
&quot;Cannot delete or update a parent row: a foreign key constraint fails&quot;

How do I remove the foreign key constraint?</description>
		<content:encoded><![CDATA[<p>Hi there,<br />
first of all thanks for this great tutorial!<br />
I am having a little trouble with something though&#8230; I want to delete a table that I created following this tutorial, because I want to change some parameters in setTableDefinition (stuff like null, notnull, unique, etc.).<br />
But when I try to drop the table I get this error message from PhpMyAdmin:<br />
&#8220;Cannot delete or update a parent row: a foreign key constraint fails&#8221;</p>
<p>How do I remove the foreign key constraint?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Armand van der Walt</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-14465</link>
		<dc:creator>Armand van der Walt</dc:creator>
		<pubDate>Mon, 30 Aug 2010 20:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-14465</guid>
		<description>Found the problem, its related to not having assigned something to $post-&gt;Companys</description>
		<content:encoded><![CDATA[<p>Found the problem, its related to not having assigned something to $post-&gt;Companys</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Armand van der Walt</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-14464</link>
		<dc:creator>Armand van der Walt</dc:creator>
		<pubDate>Mon, 30 Aug 2010 20:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-14464</guid>
		<description>I have narrowed my problem down to where in the post class I had the relationship with the company.
This is the code that gives me the error:
$this-&gt;hasOne(&#039;Companys&#039;, array(
                &#039;local&#039; =&gt; &#039;companys_id&#039;,
                &#039;foreign&#039; =&gt; &#039;id&#039;
        ));</description>
		<content:encoded><![CDATA[<p>I have narrowed my problem down to where in the post class I had the relationship with the company.<br />
This is the code that gives me the error:<br />
$this-&gt;hasOne(&#8217;Companys&#8217;, array(<br />
                &#8216;local&#8217; =&gt; &#8216;companys_id&#8217;,<br />
                &#8216;foreign&#8217; =&gt; &#8216;id&#8217;<br />
        ));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Armand van der Walt</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-14463</link>
		<dc:creator>Armand van der Walt</dc:creator>
		<pubDate>Mon, 30 Aug 2010 19:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-14463</guid>
		<description>Hi

Thanks for great tut.

But unfortunately I have a problem with my relations. I can&#039;t figure what the problem is, and its most likely something stupid that I did. Any help will be great.

Fatal error: Uncaught exception &#039;Doctrine_Connection_Mysql_Exception&#039; with message &#039;SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`ci_doctrine`.`post`, CONSTRAINT `post_companys_id_companys_id` FOREIGN KEY (`companys_id`) REFERENCES `companys` (`id`))&#039; in C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php:1082 Stack trace: #0 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection\Statement.php(269): Doctrine_Connection-&gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Statement)) #1 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php(1042): Doctrine_Connection_Statement-&gt;execute(Array) #2 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php(687): Doctrine_Connection-&gt;exec(&#039;INSERT INTO pos...&#039;, Array) #3 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection\UnitOfWork.p in C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php on line 1082

The code:
class Post extends Doctrine_Record {

	public function setTableDefinition() {
		$this-&gt;hasColumn(&#039;content&#039;, &#039;string&#039;, 65535);
		$this-&gt;hasColumn(&#039;category_id&#039;, &#039;integer&#039;, 4);
		$this-&gt;hasColumn(&#039;companys_id&#039;, &#039;integer&#039;, 4);
	}

	public function setUp() {
		$this-&gt;actAs(&#039;Timestampable&#039;);
		$this-&gt;hasOne(&#039;Category&#039;, array(
			&#039;local&#039; =&gt; &#039;category_id&#039;,
			&#039;foreign&#039; =&gt; &#039;id&#039;
		));
		$this-&gt;hasOne(&#039;Companys&#039;, array(
			&#039;local&#039; =&gt; &#039;companys_id&#039;,
			&#039;foreign&#039; =&gt; &#039;id&#039;
		));
	}

}

class Category extends Doctrine_Record {

	public function setTableDefinition() {
		$this-&gt;hasColumn(&#039;title&#039;, &#039;string&#039;, 255);
	}

	public function setUp() {
		$this-&gt;hasMany(&#039;Post as Posts&#039;, array(
			&#039;local&#039; =&gt; &#039;id&#039;,
			&#039;foreign&#039; =&gt; &#039;category_id&#039;
		));
	}
}

class Companys extends Doctrine_Record{
    public function  setTableDefinition() {
        $this-&gt;hasColumn(&#039;companyName&#039;, &#039;string&#039;, 255, array(&#039;unique&#039; =&gt; &#039;true&#039;));
        $this-&gt;hasColumn(&#039;contactPerson&#039;, &#039;string&#039;, 255);
        $this-&gt;hasColumn(&#039;contactNumber&#039;, &#039;string&#039;, 255);
        $this-&gt;hasColumn(&#039;mobileNumber&#039;, &#039;string&#039;, 255);
        $this-&gt;hasColumn(&#039;email&#039;, &#039;string&#039;, 255, array(&#039;unique&#039; =&gt; &#039;true&#039;));
        $this-&gt;hasColumn(&#039;password&#039;, &#039;string&#039;, 255);
        $this-&gt;hasColumn(&#039;category_of&#039;, &#039;string&#039;, 255);
    }

    public function  setUp() {
        $this-&gt;setTableName(&#039;companys&#039;);
        $this-&gt;actAs(&#039;Timestampable&#039;);
        $this-&gt;hasMutator(&#039;password&#039;, &#039;_encrypt_password&#039;);
        $this-&gt;hasMany(&#039;Post as Posts&#039;, array(
			&#039;local&#039; =&gt; &#039;id&#039;,
			&#039;foreign&#039; =&gt; &#039;companys_id&#039;
		));
    }

    protected function _encrypt_password($value)
    {
        $salt = &#039;#*seCret!@-*%&#039;;
        $this-&gt;_set(&#039;password&#039;, md5($salt . $value));
    }
}</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Thanks for great tut.</p>
<p>But unfortunately I have a problem with my relations. I can&#8217;t figure what the problem is, and its most likely something stupid that I did. Any help will be great.</p>
<p>Fatal error: Uncaught exception &#8216;Doctrine_Connection_Mysql_Exception&#8217; with message &#8216;SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`ci_doctrine`.`post`, CONSTRAINT `post_companys_id_companys_id` FOREIGN KEY (`companys_id`) REFERENCES `companys` (`id`))&#8217; in C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php:1082 Stack trace: #0 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection\Statement.php(269): Doctrine_Connection-&gt;rethrowException(Object(PDOException), Object(Doctrine_Connection_Statement)) #1 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php(1042): Doctrine_Connection_Statement-&gt;execute(Array) #2 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php(687): Doctrine_Connection-&gt;exec(&#8217;INSERT INTO pos&#8230;&#8217;, Array) #3 C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection\UnitOfWork.p in C:\wamp\www\ci_doctrine\system\application\plugins\doctrine\lib\Doctrine\Connection.php on line 1082</p>
<p>The code:<br />
class Post extends Doctrine_Record {</p>
<p>	public function setTableDefinition() {<br />
		$this-&gt;hasColumn(&#8217;content&#8217;, &#8217;string&#8217;, 65535);<br />
		$this-&gt;hasColumn(&#8217;category_id&#8217;, &#8216;integer&#8217;, 4);<br />
		$this-&gt;hasColumn(&#8217;companys_id&#8217;, &#8216;integer&#8217;, 4);<br />
	}</p>
<p>	public function setUp() {<br />
		$this-&gt;actAs(&#8217;Timestampable&#8217;);<br />
		$this-&gt;hasOne(&#8217;Category&#8217;, array(<br />
			&#8216;local&#8217; =&gt; &#8216;category_id&#8217;,<br />
			&#8216;foreign&#8217; =&gt; &#8216;id&#8217;<br />
		));<br />
		$this-&gt;hasOne(&#8217;Companys&#8217;, array(<br />
			&#8216;local&#8217; =&gt; &#8216;companys_id&#8217;,<br />
			&#8216;foreign&#8217; =&gt; &#8216;id&#8217;<br />
		));<br />
	}</p>
<p>}</p>
<p>class Category extends Doctrine_Record {</p>
<p>	public function setTableDefinition() {<br />
		$this-&gt;hasColumn(&#8217;title&#8217;, &#8217;string&#8217;, 255);<br />
	}</p>
<p>	public function setUp() {<br />
		$this-&gt;hasMany(&#8217;Post as Posts&#8217;, array(<br />
			&#8216;local&#8217; =&gt; &#8216;id&#8217;,<br />
			&#8216;foreign&#8217; =&gt; &#8216;category_id&#8217;<br />
		));<br />
	}<br />
}</p>
<p>class Companys extends Doctrine_Record{<br />
    public function  setTableDefinition() {<br />
        $this-&gt;hasColumn(&#8217;companyName&#8217;, &#8217;string&#8217;, 255, array(&#8217;unique&#8217; =&gt; &#8216;true&#8217;));<br />
        $this-&gt;hasColumn(&#8217;contactPerson&#8217;, &#8217;string&#8217;, 255);<br />
        $this-&gt;hasColumn(&#8217;contactNumber&#8217;, &#8217;string&#8217;, 255);<br />
        $this-&gt;hasColumn(&#8217;mobileNumber&#8217;, &#8217;string&#8217;, 255);<br />
        $this-&gt;hasColumn(&#8217;email&#8217;, &#8217;string&#8217;, 255, array(&#8217;unique&#8217; =&gt; &#8216;true&#8217;));<br />
        $this-&gt;hasColumn(&#8217;password&#8217;, &#8217;string&#8217;, 255);<br />
        $this-&gt;hasColumn(&#8217;category_of&#8217;, &#8217;string&#8217;, 255);<br />
    }</p>
<p>    public function  setUp() {<br />
        $this-&gt;setTableName(&#8217;companys&#8217;);<br />
        $this-&gt;actAs(&#8217;Timestampable&#8217;);<br />
        $this-&gt;hasMutator(&#8217;password&#8217;, &#8216;_encrypt_password&#8217;);<br />
        $this-&gt;hasMany(&#8217;Post as Posts&#8217;, array(<br />
			&#8216;local&#8217; =&gt; &#8216;id&#8217;,<br />
			&#8216;foreign&#8217; =&gt; &#8216;companys_id&#8217;<br />
		));<br />
    }</p>
<p>    protected function _encrypt_password($value)<br />
    {<br />
        $salt = &#8216;#*seCret!@-*%&#8217;;<br />
        $this-&gt;_set(&#8217;password&#8217;, md5($salt . $value));<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ahmed Tawfik</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-13069</link>
		<dc:creator>Ahmed Tawfik</dc:creator>
		<pubDate>Sun, 15 Aug 2010 07:39:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-13069</guid>
		<description>Thanks Burak , It&#039;s a good information :)</description>
		<content:encoded><![CDATA[<p>Thanks Burak , It&#8217;s a good information <img src='http://www.phpandstuff.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Voigt</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-11795</link>
		<dc:creator>Christian Voigt</dc:creator>
		<pubDate>Fri, 06 Aug 2010 14:40:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-11795</guid>
		<description>If, for example, your local key is &#039;4&#039; and the foreign key is declared as &#039;null&#039;, then you will get that exact error.</description>
		<content:encoded><![CDATA[<p>If, for example, your local key is &#8216;4&#8242; and the foreign key is declared as &#8216;null&#8217;, then you will get that exact error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cristi</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-9636</link>
		<dc:creator>cristi</dc:creator>
		<pubDate>Thu, 22 Jul 2010 10:39:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-9636</guid>
		<description>guys, i need u help in previous situation, please!</description>
		<content:encoded><![CDATA[<p>guys, i need u help in previous situation, please!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cristi</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-8740</link>
		<dc:creator>cristi</dc:creator>
		<pubDate>Wed, 14 Jul 2010 20:55:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-8740</guid>
		<description>i&#039;ve tried, but in that situation if i try to add a new user to that group i get a &quot;duplicate entry error&quot;. 

maybe u have a better idea, i just want to have groups with users, and every user to be part of just one group.</description>
		<content:encoded><![CDATA[<p>i&#8217;ve tried, but in that situation if i try to add a new user to that group i get a &#8220;duplicate entry error&#8221;. </p>
<p>maybe u have a better idea, i just want to have groups with users, and every user to be part of just one group.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Burak</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-8739</link>
		<dc:creator>Burak</dc:creator>
		<pubDate>Wed, 14 Jul 2010 20:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-8739</guid>
		<description>Try setting your group name field to unique, in your Model.</description>
		<content:encoded><![CDATA[<p>Try setting your group name field to unique, in your Model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cristi</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-8726</link>
		<dc:creator>cristi</dc:creator>
		<pubDate>Wed, 14 Jul 2010 18:49:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-8726</guid>
		<description>so after first insert i have in users table: 

id username group_id
1 user1             1

and in group table: 

id name 
1   group 1

and after second insert i have in users table: 

id username group_id
1 user1             1
1 user2             2

and in group table: 

id name 
1   group 1
2   group 1 ( - this is the problem, group 1 already exists, why is added again and is not use his id? )

i hope this time my explanation are better</description>
		<content:encoded><![CDATA[<p>so after first insert i have in users table: </p>
<p>id username group_id<br />
1 user1             1</p>
<p>and in group table: </p>
<p>id name<br />
1   group 1</p>
<p>and after second insert i have in users table: </p>
<p>id username group_id<br />
1 user1             1<br />
1 user2             2</p>
<p>and in group table: </p>
<p>id name<br />
1   group 1<br />
2   group 1 ( &#8211; this is the problem, group 1 already exists, why is added again and is not use his id? )</p>
<p>i hope this time my explanation are better</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cristi</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-8719</link>
		<dc:creator>cristi</dc:creator>
		<pubDate>Wed, 14 Jul 2010 17:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-8719</guid>
		<description>hy. 

i have a question

let say we have 2 tables: 
1. user - [id] [username][password][group_id]
2. group - [id] [name]

if I say  user has one group and group has many users - conditions

if i try to do something like here: 	
		$u-&gt;username= &#039;user1&#039;;
			$u-&gt;Group-&gt;name = &quot;grup1&quot;;
			$u-&gt;save();
it will insert in table user 1 record and in column group_id value  1. 

Problem is if i  want to add another user to same group, instead to insert a new line in only table user with value 1 on group_id field, i get inserted a row in user with group_id2 and in group another row with id 2 and same name. 

Any help will be apreciated. 

Thanks</description>
		<content:encoded><![CDATA[<p>hy. </p>
<p>i have a question</p>
<p>let say we have 2 tables:<br />
1. user &#8211; [id] [username][password][group_id]<br />
2. group &#8211; [id] [name]</p>
<p>if I say  user has one group and group has many users &#8211; conditions</p>
<p>if i try to do something like here:<br />
		$u-&gt;username= &#8216;user1&#8242;;<br />
			$u-&gt;Group-&gt;name = &#8220;grup1&#8243;;<br />
			$u-&gt;save();<br />
it will insert in table user 1 record and in column group_id value  1. </p>
<p>Problem is if i  want to add another user to same group, instead to insert a new line in only table user with value 1 on group_id field, i get inserted a row in user with group_id2 and in group another row with id 2 and same name. </p>
<p>Any help will be apreciated. </p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivankruel</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-8637</link>
		<dc:creator>ivankruel</dc:creator>
		<pubDate>Tue, 13 Jul 2010 21:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-8637</guid>
		<description>sorry forgot the comment, i&#039;m stock in here any adia about the error:

            $query = new Doctrine_Query();
    $query-&gt;select(&#039;c.fecha, c.folio, c.sps, c.nompac, d.clave_c, d.corto, d.canreq, d.cansur&#039;);
    $query-&gt;from(&#039;captura c&#039;);
    $query-&gt;leftJoin(&#039;c.detalle d&#039;);
    $query-&gt;where(&#039;c.idsuc=?&#039;, $this-&gt;input-&gt;post(&#039;sucursal&#039;));
    $query-&gt;addWhere(&#039;c.fecha between ? and ?&#039;, array($per[0][&#039;perini&#039;], $per[0][&#039;perfin&#039;]));
    $query-&gt;orderBy(&#039;c.fecha, c.sps&#039;);
    $query-&gt;setHydrationMode(Doctrine::HYDRATE_ARRAY);
    $query-&gt;execute();</description>
		<content:encoded><![CDATA[<p>sorry forgot the comment, i&#8217;m stock in here any adia about the error:</p>
<p>            $query = new Doctrine_Query();<br />
    $query-&gt;select(&#8217;c.fecha, c.folio, c.sps, c.nompac, d.clave_c, d.corto, d.canreq, d.cansur&#8217;);<br />
    $query-&gt;from(&#8217;captura c&#8217;);<br />
    $query-&gt;leftJoin(&#8217;c.detalle d&#8217;);<br />
    $query-&gt;where(&#8217;c.idsuc=?&#8217;, $this-&gt;input-&gt;post(&#8217;sucursal&#8217;));<br />
    $query-&gt;addWhere(&#8217;c.fecha between ? and ?&#8217;, array($per[0]['perini'], $per[0]['perfin']));<br />
    $query-&gt;orderBy(&#8217;c.fecha, c.sps&#8217;);<br />
    $query-&gt;setHydrationMode(Doctrine::HYDRATE_ARRAY);<br />
    $query-&gt;execute();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivankruel</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-8636</link>
		<dc:creator>ivankruel</dc:creator>
		<pubDate>Tue, 13 Jul 2010 21:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-8636</guid>
		<description>Fatal error: Uncaught exception &#039;Doctrine_Table_Exception&#039; with message &#039;Unknown relation alias detalle&#039; in C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Relation\Parser.php:237 Stack trace: #0 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Relation\Parser.php(235): Doctrine_Relation_Parser-&gt;getRelation(&#039;detalle&#039;, false) #1 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Table.php(1001): Doctrine_Relation_Parser-&gt;getRelation(&#039;detalle&#039;, true) #2 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query.php(1736): Doctrine_Table-&gt;getRelation(&#039;detalle&#039;) #3 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query\From.php(88): Doctrine_Query-&gt;load(&#039;c.detalle d&#039;) #4 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query\Abstract.php(2077): Doctrine_Query_From-&gt;parse(&#039;LEFT JOIN c.det...&#039;) #5 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query.php(1160): Doctrine_Query_Abst in C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Relation\Parser.php on line 237</description>
		<content:encoded><![CDATA[<p>Fatal error: Uncaught exception &#8216;Doctrine_Table_Exception&#8217; with message &#8216;Unknown relation alias detalle&#8217; in C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Relation\Parser.php:237 Stack trace: #0 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Relation\Parser.php(235): Doctrine_Relation_Parser-&gt;getRelation(&#8217;detalle&#8217;, false) #1 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Table.php(1001): Doctrine_Relation_Parser-&gt;getRelation(&#8217;detalle&#8217;, true) #2 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query.php(1736): Doctrine_Table-&gt;getRelation(&#8217;detalle&#8217;) #3 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query\From.php(88): Doctrine_Query-&gt;load(&#8217;c.detalle d&#8217;) #4 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query\Abstract.php(2077): Doctrine_Query_From-&gt;parse(&#8217;LEFT JOIN c.det&#8230;&#8217;) #5 C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Query.php(1160): Doctrine_Query_Abst in C:\wamp\www\pueblareceta\system\plugins\doctrine\Doctrine\lib\Doctrine\Relation\Parser.php on line 237</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: musonic</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-8085</link>
		<dc:creator>musonic</dc:creator>
		<pubDate>Wed, 07 Jul 2010 13:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-8085</guid>
		<description>Firstly, fantastic tutorials. The best I&#039;ve seen. I&#039;m having some problems though and hope you can help. I&#039;m trying to set up a one to one relationship between a Login and a User table. They are linked by the id column in the User table. For some reason when i create the tables the column user_id in the Login table will not create in the way I expect. If I simply declare &quot;integer&quot; a column with type bigint(20) is created. If I use &quot;int&quot; then a column with type &quot;int(11)&quot; is created and the same happens if I specify a length. The automatically created id column in the User table is of type &quot;int(10)&quot; and is unsigned. Even though cols are meant to be unsigned by default my user_id is not. Any ideas why this is happening?</description>
		<content:encoded><![CDATA[<p>Firstly, fantastic tutorials. The best I&#8217;ve seen. I&#8217;m having some problems though and hope you can help. I&#8217;m trying to set up a one to one relationship between a Login and a User table. They are linked by the id column in the User table. For some reason when i create the tables the column user_id in the Login table will not create in the way I expect. If I simply declare &#8220;integer&#8221; a column with type bigint(20) is created. If I use &#8220;int&#8221; then a column with type &#8220;int(11)&#8221; is created and the same happens if I specify a length. The automatically created id column in the User table is of type &#8220;int(10)&#8221; and is unsigned. Even though cols are meant to be unsigned by default my user_id is not. Any ideas why this is happening?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darel</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-7215</link>
		<dc:creator>Darel</dc:creator>
		<pubDate>Fri, 25 Jun 2010 19:17:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-7215</guid>
		<description>Burak, thanks for the fast response. I&#039;m really loving this Tutorial!</description>
		<content:encoded><![CDATA[<p>Burak, thanks for the fast response. I&#8217;m really loving this Tutorial!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Burak</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-7212</link>
		<dc:creator>Burak</dc:creator>
		<pubDate>Fri, 25 Jun 2010 18:07:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-7212</guid>
		<description>The diagram was just an example. Not the exact plan for the code.</description>
		<content:encoded><![CDATA[<p>The diagram was just an example. Not the exact plan for the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darel</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-7211</link>
		<dc:creator>Darel</dc:creator>
		<pubDate>Fri, 25 Jun 2010 18:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-7211</guid>
		<description>Burak, 

Your Test model has Categories assigned to forums in the code, but I don&#039;t see the relationships in your diagram. Was there a reason for that?</description>
		<content:encoded><![CDATA[<p>Burak, </p>
<p>Your Test model has Categories assigned to forums in the code, but I don&#8217;t see the relationships in your diagram. Was there a reason for that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J Manninen</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-5785</link>
		<dc:creator>J Manninen</dc:creator>
		<pubDate>Wed, 26 May 2010 10:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-5785</guid>
		<description>Ok, thats fixed. It seems that InnoDB doesnt accept empty values for relations. I changed to MyISAM and now it works.</description>
		<content:encoded><![CDATA[<p>Ok, thats fixed. It seems that InnoDB doesnt accept empty values for relations. I changed to MyISAM and now it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J Manninen</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-5594</link>
		<dc:creator>J Manninen</dc:creator>
		<pubDate>Sun, 23 May 2010 17:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-5594</guid>
		<description>Hi,

Just a &quot;quick&quot; question about relationships in doctrine. Ie. if you create table called paper, and it belongs to a category, so i would define hasOne in paper-model, and hasMany in category -table.

I have done that, but when i try to save paper without giving it a category value, it gives me a error. I haven&#039;t defined that category is required value. But is it so, that if you define relationships, the value becomes required?

I also have defined created_by field in paper-model, and it links to user-table. But it should not be required, but it doesnt allow me to save if created_by is not set.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Just a &#8220;quick&#8221; question about relationships in doctrine. Ie. if you create table called paper, and it belongs to a category, so i would define hasOne in paper-model, and hasMany in category -table.</p>
<p>I have done that, but when i try to save paper without giving it a category value, it gives me a error. I haven&#8217;t defined that category is required value. But is it so, that if you define relationships, the value becomes required?</p>
<p>I also have defined created_by field in paper-model, and it links to user-table. But it should not be required, but it doesnt allow me to save if created_by is not set.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Broncha</title>
		<link>http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships/comment-page-1#comment-5255</link>
		<dc:creator>Broncha</dc:creator>
		<pubDate>Fri, 14 May 2010 16:40:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpandstuff.com/?p=500#comment-5255</guid>
		<description>Nice tutorial.This is the best series of tutorials I&#039;ve got in the Internet. Doctrine makes it real easy to build application.
Thanks.Waiting for the rest of the tutorials from day12 :)</description>
		<content:encoded><![CDATA[<p>Nice tutorial.This is the best series of tutorials I&#8217;ve got in the Internet. Doctrine makes it real easy to build application.<br />
Thanks.Waiting for the rest of the tutorials from day12 <img src='http://www.phpandstuff.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
