<?xml version="1.0" encoding="utf-8"?>
		<feed xmlns="http://www.w3.org/2005/Atom">
			<title type="text">Akelos PHP Framework Forum - find, has_one association, errors</title>
			<updated>2010-09-10T09:01:58+02:00</updated>
			<id>http://forum.akelos.org/</id>
			<link rel="alternate" type="text/html" hreflang="en"
				href="http://forum.akelos.org/discussion/?DiscussionID=686&amp;page=1"/>
			<link rel="self" type="application/atom+xml"
				href="http://forum.akelos.org/discussion/?DiscussionID=686&amp;Feed=ATOM&amp;page=1"/>
			<generator
				uri="http://getvanilla.com/"
				version="1.1.4">
				Lussumo Vanilla &amp; Feed Publisher
			</generator>
			<entry>
		<title>find, has_one association, errors</title>
		<link rel="alternate" href="http://forum.akelos.org/discussion/686/?Focus=2872#Comment_2872" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.akelos.org/discussion/686/?Focus=2872#Comment_2872</id>
		<published>2008-11-15T21:22:29+01:00</published>
		<updated>2010-09-10T09:01:58+02:00</updated>
		<author>
			<name>bloogrox</name>
			<uri>http://forum.akelos.org/account/408/</uri>
		</author>
		<summary type="text" xml:lang="en">
			Hi!
i have model User, User $has_one Wallet
code:
$Wallet = $_User-&gt;wallet-&gt;find(); // i want to retrieve wallet object associated to user 
raises:
 Notice: Tried 'SELECT wallets.* FROM ...
		</summary>
		<content type="html">
			<![CDATA[Hi!<br />i have model User, User $has_one Wallet<br />code:<br />$Wallet = $_User-&gt;wallet-&gt;find(); // i want to retrieve wallet object associated to user <br />raises:<br /> Notice: Tried 'SELECT wallets.* FROM wallets LEFT OUTER JOIN users ON users.id = wallets.user_id WHERE wallets.user_id = '12' AND ( __owner.type = 'User' ) '. Got: [1054] Unknown column '__owner.type' in 'where clause' in C:\xampp\htdocs\showbirja\lib\AkActiveRecord\AkDbAdapter.php on line 226<br /><br />i copy paste this sql to sqlmanager and execute,<br />without &quot;AND ( __owner.type = 'User' )&quot; it works fine<br /><br />is it bug?<br />how could i get over it ?<br /><br />thnx!]]>
		</content>
	</entry>
	<entry>
		<title>find, has_one association, errors</title>
		<link rel="alternate" href="http://forum.akelos.org/discussion/686/?Focus=2885#Comment_2885" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.akelos.org/discussion/686/?Focus=2885#Comment_2885</id>
		<published>2008-11-18T10:30:22+01:00</published>
		<updated>2008-11-18T10:30:29+01:00</updated>
		<author>
			<name>suthern</name>
			<uri>http://forum.akelos.org/account/128/</uri>
		</author>
		<summary type="text" xml:lang="en">
			If each user has only one wallet, (Table user has 'wallet_id'), what about using
`$Wallet = $_User-&gt;wallet-&gt;load();`
		</summary>
		<content type="html">
			<![CDATA[<p>If each user has only one wallet, (Table user has 'wallet_id'), what about using
<code>$Wallet = $_User-&gt;wallet-&gt;load();</code></p>
]]>
		</content>
	</entry>
	<entry>
		<title>find, has_one association, errors</title>
		<link rel="alternate" href="http://forum.akelos.org/discussion/686/?Focus=2887#Comment_2887" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.akelos.org/discussion/686/?Focus=2887#Comment_2887</id>
		<published>2008-11-18T16:29:32+01:00</published>
		<updated>2010-09-10T09:01:58+02:00</updated>
		<author>
			<name>bloogrox</name>
			<uri>http://forum.akelos.org/account/408/</uri>
		</author>
		<summary type="text" xml:lang="en">
			and what if 
Table wallet has 'user_id', but
table user doesn't have 'wallet_id'.
		</summary>
		<content type="html">
			<![CDATA[and what if <br />Table wallet has 'user_id', but<br />table user doesn't have 'wallet_id'.]]>
		</content>
	</entry>
	<entry>
		<title>find, has_one association, errors</title>
		<link rel="alternate" href="http://forum.akelos.org/discussion/686/?Focus=3457#Comment_3457" type="application/xhtml+xml" hreflang="en"/>
		<id>http://forum.akelos.org/discussion/686/?Focus=3457#Comment_3457</id>
		<published>2010-06-22T17:39:26+02:00</published>
		<updated>2010-09-10T09:01:58+02:00</updated>
		<author>
			<name>suthern</name>
			<uri>http://forum.akelos.org/account/128/</uri>
		</author>
		<summary type="text" xml:lang="en">
			BlooGrox, this thread is a couple of years old. Are you still around? Sorry I never saw your response. 

Putting the user_id inside the schema wallet is interesting. As long as you have defined ...
		</summary>
		<content type="html">
			<![CDATA[<p>BlooGrox, this thread is a couple of years old. Are you still around? Sorry I never saw your response.</p>

<p>Putting the user_id inside the schema wallet is interesting. As long as you have defined your models correctly (Has_one and belongs_to), then</p>

<pre><code>$this-&gt;User-&gt;wallet-&gt;load();
</code></pre>

<p>should work just fine.</p>
]]>
		</content>
	</entry>
	
		</feed>