<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>acloudtree &#187; findByYear</title>
	<atom:link href="http://www.acloudtree.com/tag/findbyyear/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.acloudtree.com</link>
	<description>Programming, Computers, Writing, Economics, and Life</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:03:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Beginning Cakephp &#8211; Errata : Pg 106</title>
		<link>http://www.acloudtree.com/beginning-cakephp-errata-pg-106/</link>
		<comments>http://www.acloudtree.com/beginning-cakephp-errata-pg-106/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 00:17:56 +0000</pubDate>
		<dc:creator>jared.folkins</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[106]]></category>
		<category><![CDATA[beginning cakephp]]></category>
		<category><![CDATA[errata]]></category>
		<category><![CDATA[findByYear]]></category>

		<guid isPermaLink="false">http://www.acloudtree.com/?p=44</guid>
		<description><![CDATA[The findByYear() function is messed up in the book. Thought I would post the correction to remind myself. Correct! function findByYear($year=null) { $date = $year.'-01-01 00:00:00'; $end_date = $year.'-12-31 23:59:59'; return $this-&#62;find('all', array( 'conditions' =&#62; array( 'DATE(Post.date) &#62;' =&#62; $date, 'DATE(Post.date) &#60;' =&#62; $end_date ) ) ); } Incorrect! function findByYear($year=null) { $date = $year.'-01-01 [...]]]></description>
			<content:encoded><![CDATA[<p>The findByYear() function is messed up in the book. Thought I would post the correction to remind myself.</p>
<p>Correct!<br />
<code></p>
<pre>
function findByYear($year=null) {
	$date = $year.'-01-01 00:00:00';
	$end_date = $year.'-12-31 23:59:59';
	return $this-&gt;find('all',
		array(
			'conditions' =&gt;
			array(
				'DATE(Post.date) &gt;' =&gt; $date,
				'DATE(Post.date) &lt;' =&gt; $end_date
			)
		 )
	);
}
</pre>
<p></code><br />
Incorrect!<br />
<code></p>
<pre>
function findByYear($year=null) {
	$date = $year.'-01-01 00:00:00';
	$end_date = $year.'-12-31 23:59:59';
	return $this-&gt;find('all',
		array(
			'conditions' =&gt;
			array(
				'DATE(Post.date)' =&gt; '&gt;'.$date,
				'DATE(Post.date)' =&gt; '&lt;'.$end_date
			)
		)
	);
}
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.acloudtree.com/beginning-cakephp-errata-pg-106/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

