<?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: Simple CakeAMFPhp How To</title>
	<atom:link href="http://blog.madarco.net/32/simple-cakeamfphp-how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.madarco.net/32/simple-cakeamfphp-how-to/</link>
	<description>on Flash, Java, Webdesign</description>
	<pubDate>Tue, 06 Jan 2009 03:01:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Madarco</title>
		<link>http://blog.madarco.net/32/simple-cakeamfphp-how-to/comment-page-1/#comment-3376</link>
		<dc:creator>Madarco</dc:creator>
		<pubDate>Sat, 17 Feb 2007 09:33:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.madarco.net/32/simple-cakeamfphp-how-to/#comment-3376</guid>
		<description>Thanks, It is really useful with Has_one relationships, I have to try it with Has_Many to see what happens. Btw, I'm waiting for a new version of CakeAmfPhp with &lt;a href="http://www.5etdemi.com/blog/" rel="nofollow"&gt;AMFPhp 2.0&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Thanks, It is really useful with Has_one relationships, I have to try it with Has_Many to see what happens. Btw, I&#8217;m waiting for a new version of CakeAmfPhp with <a href="http://www.5etdemi.com/blog/" rel="nofollow">AMFPhp 2.0</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://blog.madarco.net/32/simple-cakeamfphp-how-to/comment-page-1/#comment-3336</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Thu, 15 Feb 2007 22:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.madarco.net/32/simple-cakeamfphp-how-to/#comment-3336</guid>
		<description>Okay, now I'm not sure how well this will perform but it appears to work so far. The following is a modified version of the amfBB example.

[code]
	function amfRead($offset = 0, $limit = 10) 
	{
		$data = $this-&#62;BulletinBoard-&#62;findAll(null, null, 'BulletinBoard.created DESC', $limit, $page, 0);
		
		$r = array();
		foreach(array_keys($data[0]) as $tableName)
		{
			for($i=0;$i$value)
				{
					$r[$i][$tableName.'_'.$key] = $value;
				}
			}
		}
		
		return new Arrayf($r, array_keys($r[0]) );
	}
	
	function amfRead_count() {
		return $this-&#62;BulletinBoard-&#62;findCount();
	}
[/code]

Which will return the following:
[code]
RecordSet 
-data
--array 
---0
----array 
-----BulletinBoard_id		1 
-----BulletinBoard_user_id	1 
-----BulletinBoard_email	user@domain.com 
-----BulletinBoard_url		http://www.domain.com 
-----BulletinBoard_message	Some message
-----BulletinBoard_created	2007-02-15 11:33:26 
-----BulletinBoard_modified	2007-02-15 11:33:26 
-----User_id		1 
-----User_name		user 
-----User_created		2007-02-14 15:19:52 
-----User_modified		2007-02-14 15:19:52 
[/code]

- Brian</description>
		<content:encoded><![CDATA[<p>Okay, now I'm not sure how well this will perform but it appears to work so far. The following is a modified version of the amfBB example.</p>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div class="igBar"><span id="lcode-1"><a href="#" onclick="javascript:showPlainTxt('code-1'); return false;">PLAIN TEXT</a></span></div>
<div id="code-1">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function amfRead<span style="color:#006600; font-weight:bold;">&#40;</span>$offset = <span style="color:#800000;color:#800000;">0</span>, $limit = <span style="color:#800000;color:#800000;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $data = $this-&amp;gt;BulletinBoard-&amp;gt;findAll<span style="color:#006600; font-weight:bold;">&#40;</span>null, null, <span style="color:#CC0000;">'BulletinBoard.created DESC'</span>, $limit, $page, <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $r = array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; foreach<span style="color:#006600; font-weight:bold;">&#40;</span>array_keys<span style="color:#006600; font-weight:bold;">&#40;</span>$data<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> as $tableName<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>$i=<span style="color:#800000;color:#800000;">0</span>;$i$value<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $r<span style="color:#006600; font-weight:bold;">&#91;</span>$i<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span>$tableName.<span style="color:#CC0000;">'_'</span>.$key<span style="color:#006600; font-weight:bold;">&#93;</span> = $value;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; return new Arrayf<span style="color:#006600; font-weight:bold;">&#40;</span>$r, array_keys<span style="color:#006600; font-weight:bold;">&#40;</span>$r<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; function amfRead_count<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; return $this-&amp;gt;BulletinBoard-&amp;gt;findCount<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>Which will return the following:</p>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RecordSet </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-data</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">--array </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">---<span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">----array </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----BulletinBoard_id&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#800000;color:#800000;">1</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----BulletinBoard_user_id&nbsp; <span style="color:#800000;color:#800000;">1</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----BulletinBoard_email&nbsp; &nbsp; user@domain.<span style="">com</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----BulletinBoard_url&nbsp; &nbsp; http:<span style="color:#FF9933; font-style:italic;">//www.domain.com </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----BulletinBoard_message&nbsp; Some message</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----BulletinBoard_created&nbsp; <span style="color:#800000;color:#800000;">2007</span>-<span style="color:#800000;color:#800000;">02</span>-<span style="color:#800000;color:#800000;">15</span> <span style="color:#800000;color:#800000;">11</span>:<span style="color:#800000;color:#800000;">33</span>:<span style="color:#800000;color:#800000;">26</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----BulletinBoard_modified&nbsp;<span style="color:#800000;color:#800000;">2007</span>-<span style="color:#800000;color:#800000;">02</span>-<span style="color:#800000;color:#800000;">15</span> <span style="color:#800000;color:#800000;">11</span>:<span style="color:#800000;color:#800000;">33</span>:<span style="color:#800000;color:#800000;">26</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----User_id&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">1</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----User_name&nbsp; &nbsp; user </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----User_created&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#800000;color:#800000;">2007</span>-<span style="color:#800000;color:#800000;">02</span>-<span style="color:#800000;color:#800000;">14</span> <span style="color:#800000;color:#800000;">15</span>:<span style="color:#800000;color:#800000;">19</span>:<span style="color:#800000;color:#800000;">52</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-----User_modified&nbsp; &nbsp; <span style="color:#800000;color:#800000;">2007</span>-<span style="color:#800000;color:#800000;">02</span>-<span style="color:#800000;color:#800000;">14</span> <span style="color:#800000;color:#800000;">15</span>:<span style="color:#800000;color:#800000;">19</span>:<span style="color:#800000;color:#800000;">52</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>- Brian</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.508 seconds -->
