<?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: An alternative way to define custom find types</title>
	<atom:link href="http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Sat, 13 Mar 2010 15:19:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-113526</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 26 Nov 2008 16:21:25 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-113526</guid>
		<description>@Rafael: No problem, wordpress is sometimes a bit arbitrary ;-)</description>
		<content:encoded><![CDATA[<p>@Rafael: No problem, wordpress is sometimes a bit arbitrary ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rafaelbandeira3</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-113327</link>
		<dc:creator>rafaelbandeira3</dc:creator>
		<pubDate>Sun, 23 Nov 2008 17:06:21 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-113327</guid>
		<description>hey Daniel, sorry for this spammy pingback, I checked the checkbox to auto pingback links, and it even pinged my own posts back... really sorry.</description>
		<content:encoded><![CDATA[<p>hey Daniel, sorry for this spammy pingback, I checked the checkbox to auto pingback links, and it even pinged my own posts back&#8230; really sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pretty, Painless and Productive debug with DebugKit &#171; Something on Everything</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-113309</link>
		<dc:creator>Pretty, Painless and Productive debug with DebugKit &#171; Something on Everything</dc:creator>
		<pubDate>Sun, 23 Nov 2008 06:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-113309</guid>
		<description>[...] a merchand a use case of the [7640] changes a real world [...]</description>
		<content:encoded><![CDATA[<p>[...] a merchand a use case of the [7640] changes a real world [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rafaelbandeira3</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-111226</link>
		<dc:creator>rafaelbandeira3</dc:creator>
		<pubDate>Fri, 24 Oct 2008 18:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-111226</guid>
		<description>@cakebaker: I wrote about it last month, on: 
http://rafaelbandeira3.wordpress.com/2008/09/11/paginating-different-find-types/ 

and the follow-up explaining how to enable paginateCount for it is on my drafts, waiting to be edited... but I would really think much more usable if you could write about it... you certainlly doc much better than I do.</description>
		<content:encoded><![CDATA[<p>@cakebaker: I wrote about it last month, on:<br />
<a href="http://rafaelbandeira3.wordpress.com/2008/09/11/paginating-different-find-types/" rel="nofollow">http://rafaelbandeira3.wordpress.com/2008/09/11/paginating-different-find-types/</a> </p>
<p>and the follow-up explaining how to enable paginateCount for it is on my drafts, waiting to be edited&#8230; but I would really think much more usable if you could write about it&#8230; you certainlly doc much better than I do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-111218</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Fri, 24 Oct 2008 16:26:19 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-111218</guid>
		<description>@Rafael: Hm, and how do you say the pagination functionality which find type it should use? I thought it uses always find(&#039;all&#039;)...</description>
		<content:encoded><![CDATA[<p>@Rafael: Hm, and how do you say the pagination functionality which find type it should use? I thought it uses always find(&#8216;all&#8217;)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rafaelbandeira3</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-111115</link>
		<dc:creator>rafaelbandeira3</dc:creator>
		<pubDate>Thu, 23 Oct 2008 16:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-111115</guid>
		<description>@cakebaker : so instead of using a two-state method, you endup with a second method dealing with it. Well I think it&#039;s a matter of use case and then taste - because with 10 to 15 find methods generating different and dynamic reports, if I would implement a call for each on my paginate(), I would end in a messy trouble. btw, thanks for the thread</description>
		<content:encoded><![CDATA[<p>@cakebaker : so instead of using a two-state method, you endup with a second method dealing with it. Well I think it&#8217;s a matter of use case and then taste &#8211; because with 10 to 15 find methods generating different and dynamic reports, if I would implement a call for each on my paginate(), I would end in a messy trouble. btw, thanks for the thread</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-111112</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 23 Oct 2008 16:18:47 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-111112</guid>
		<description>@Rafael: By implementing the paginate() method in my model.</description>
		<content:encoded><![CDATA[<p>@Rafael: By implementing the paginate() method in my model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rafaelbandeira3</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-110991</link>
		<dc:creator>rafaelbandeira3</dc:creator>
		<pubDate>Wed, 22 Oct 2008 11:56:43 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-110991</guid>
		<description>@cakebaker: and how do you manage pagination then? - ok, a findRecent wouldn&#039;t really need pagination, but for a report for example.</description>
		<content:encoded><![CDATA[<p>@cakebaker: and how do you manage pagination then? &#8211; ok, a findRecent wouldn&#8217;t really need pagination, but for a report for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-110884</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 21 Oct 2008 16:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-110884</guid>
		<description>@Rafael: No, I haven&#039;t used it in practice yet. And I&#039;m not sure whether I will adopt this approach. I think it is easier to write a method findRecent() which internally uses the find() method instead of writing a _findRecent() method as shown in the article.</description>
		<content:encoded><![CDATA[<p>@Rafael: No, I haven&#8217;t used it in practice yet. And I&#8217;m not sure whether I will adopt this approach. I think it is easier to write a method findRecent() which internally uses the find() method instead of writing a _findRecent() method as shown in the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafael Bandeira</title>
		<link>http://cakebaker.42dh.com/2008/09/23/an-alternative-way-to-define-custom-find-types/comment-page-1/#comment-110755</link>
		<dc:creator>Rafael Bandeira</dc:creator>
		<pubDate>Mon, 20 Oct 2008 19:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=848#comment-110755</guid>
		<description>@taylor: the snippet is very usefull but needs some fixes: first of all it will miss find(&#039;all&#039;) as there&#039;s no _findAll() method and second is that it&#039;s strtolower() on method&#039;s name takes a little bit of readability, don&#039;t you think?

&lt;code&gt;
$this-&gt;find(&#039;pricingreport&#039;); 
// is a little bit worse than
$this-&gt;find(&#039;pricingReport&#039;);

$this-&gt;find(&#039;totalworkedtimereport&#039;);
// is much worse than 
$this-&gt;find(&#039;totalWorkedTimeReport&#039;);
&lt;/code&gt;

ok it&#039;s about taste, but the find(&#039;all&#039;) is much more than an issue:

&lt;code&gt;
class AppModel extends Model {
	public function __construct($id = false, $table = null, $ds = null) {
		foreach(get_class_methods($this) as $method) {
			if (strpos($method, &#039;_find&#039;) !== false) {
				$method = Inflector::variable(str_replace(&#039;_find&#039;, &#039;&#039;, $method));
				$finders[$method] = true;
			}
		}
		$this-&gt;_findMethods = $finders + array(&#039;all&#039; =&gt; true);
		parent::__construct($id, $table, $ds);
	}
}
&lt;/code&gt;

@cakebaker: so far, have you started using it? I&#039;m using it a lot, actually I only use it, all reports, views, tables and lists are generated this way... how about you?</description>
		<content:encoded><![CDATA[<p>@taylor: the snippet is very usefull but needs some fixes: first of all it will miss find(&#8216;all&#8217;) as there&#8217;s no _findAll() method and second is that it&#8217;s strtolower() on method&#8217;s name takes a little bit of readability, don&#8217;t you think?</p>
<pre><code>$this-&gt;find('pricingreport'); 
// is a little bit worse than
$this-&gt;find('pricingReport');

$this-&gt;find('totalworkedtimereport');
// is much worse than 
$this-&gt;find('totalWorkedTimeReport');</code></pre>
<p>ok it&#8217;s about taste, but the find(&#8216;all&#8217;) is much more than an issue:</p>
<pre><code>class AppModel extends Model {
	public function __construct($id = false, $table = null, $ds = null) {
		foreach(get_class_methods($this) as $method) {
			if (strpos($method, '_find') !== false) {
				$method = Inflector::variable(str_replace('_find', '', $method));
				$finders[$method] = true;
			}
		}
		$this-&gt;_findMethods = $finders + array('all' =&gt; true);
		parent::__construct($id, $table, $ds);
	}
}</code></pre>
<p>@cakebaker: so far, have you started using it? I&#8217;m using it a lot, actually I only use it, all reports, views, tables and lists are generated this way&#8230; how about you?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
