<?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: CakePHP 1.2 tip of the day: be mindful of Model::set</title>
	<atom:link href="http://marianoiglesias.com.ar/cakephp/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/feed/" rel="self" type="application/rss+xml" />
	<link>http://marianoiglesias.com.ar/cakephp/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/</link>
	<description>A glimpse at a coder&#039;s troubled mind</description>
	<lastBuildDate>Wed, 30 Jun 2010 11:12:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: PHPSC [Visitor]</title>
		<link>http://marianoiglesias.com.ar/cakephp/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/comment-page-1/#comment-114</link>
		<dc:creator>PHPSC [Visitor]</dc:creator>
		<pubDate>Thu, 18 Oct 2007 19:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://marianoiglesias.com.ar/1/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/#comment-114</guid>
		<description>I have to say i agree with Daniel. If there is something which is generally misunderstood by everyone then maybe it should be named better.&lt;br /&gt;
&lt;br /&gt;
Regarding using the &quot;create&quot; function that can be a problem when u want to update the data after validation instead of inserting a new record. Thats because in 1.2 &quot;create&quot; also retrieves the default values set for a field from the table definition. So it will update a field with default value even if i don&#039;t want to. I am still an amateur in cakePHP so please correct me if i am wrong.
</description>
		<content:encoded><![CDATA[<p>I have to say i agree with Daniel. If there is something which is generally misunderstood by everyone then maybe it should be named better.</p>
<p>Regarding using the &#8220;create&#8221; function that can be a problem when u want to update the data after validation instead of inserting a new record. Thats because in 1.2 &#8220;create&#8221; also retrieves the default values set for a field from the table definition. So it will update a field with default value even if i don&#8217;t want to. I am still an amateur in cakePHP so please correct me if i am wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Hofstetter [Visitor]</title>
		<link>http://marianoiglesias.com.ar/cakephp/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/comment-page-1/#comment-113</link>
		<dc:creator>Daniel Hofstetter [Visitor]</dc:creator>
		<pubDate>Mon, 01 Oct 2007 08:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://marianoiglesias.com.ar/1/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/#comment-113</guid>
		<description>That&#039;s not what I am saying. What I am saying is that I don&#039;t expect that the arrays get merged if I have something like:&lt;br /&gt;
&lt;br /&gt;
$this-&gt;set($arrayA);&lt;br /&gt;
$this-&gt;set($arrayB);&lt;br /&gt;
&lt;br /&gt;
The semantic is not correct and so people get it wrong. But if I have something like&lt;br /&gt;
&lt;br /&gt;
$this-&gt;set(&#039;var1&#039;, $value1);&lt;br /&gt;
$this-&gt;set(&#039;var2&#039;, $value2);&lt;br /&gt;
&lt;br /&gt;
then I expect both variables in the view.&lt;br /&gt;
&lt;br /&gt;
If you want to see my comments as complaining, then see it as complaining, even though it is meant as feedback.
</description>
		<content:encoded><![CDATA[<p>That&#8217;s not what I am saying. What I am saying is that I don&#8217;t expect that the arrays get merged if I have something like:</p>
<p>$this-&gt;set($arrayA);<br />
$this-&gt;set($arrayB);</p>
<p>The semantic is not correct and so people get it wrong. But if I have something like</p>
<p>$this-&gt;set(&#8216;var1&#8242;, $value1);<br />
$this-&gt;set(&#8216;var2&#8242;, $value2);</p>
<p>then I expect both variables in the view.</p>
<p>If you want to see my comments as complaining, then see it as complaining, even though it is meant as feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mariano.iglesias [Member]</title>
		<link>http://marianoiglesias.com.ar/cakephp/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/comment-page-1/#comment-112</link>
		<dc:creator>mariano.iglesias [Member]</dc:creator>
		<pubDate>Sun, 30 Sep 2007 16:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://marianoiglesias.com.ar/1/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/#comment-112</guid>
		<description>@Daniel: I completely disagree. But then again you know that already, and for some reason you are only but complaining lately so I think there&#039;s no need for a debate. In any way, Model::set behaves exactly as Controller::set. And what you are asking is that in controller if you do:&lt;br /&gt;
&lt;br /&gt;
$this-&gt;set(&#039;var1&#039;, &#039;value1&#039;);&lt;br /&gt;
&lt;br /&gt;
and then later on:&lt;br /&gt;
&lt;br /&gt;
$this-&gt;set(&#039;var2&#039;, &#039;value2&#039;);&lt;br /&gt;
&lt;br /&gt;
Then only var2 will be available in the view. Ask ANY baker in the world and they&#039;ll say THAT&#039;S CRAP, regardless of what YOU deem as adequate for the method.
</description>
		<content:encoded><![CDATA[<p>@Daniel: I completely disagree. But then again you know that already, and for some reason you are only but complaining lately so I think there&#8217;s no need for a debate. In any way, Model::set behaves exactly as Controller::set. And what you are asking is that in controller if you do:</p>
<p>$this->set(&#8216;var1&#8242;, &#8216;value1&#8242;);</p>
<p>and then later on:</p>
<p>$this->set(&#8216;var2&#8242;, &#8216;value2&#8242;);</p>
<p>Then only var2 will be available in the view. Ask ANY baker in the world and they&#8217;ll say THAT&#8217;S CRAP, regardless of what YOU deem as adequate for the method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Hofstetter [Visitor]</title>
		<link>http://marianoiglesias.com.ar/cakephp/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/comment-page-1/#comment-111</link>
		<dc:creator>Daniel Hofstetter [Visitor]</dc:creator>
		<pubDate>Sun, 30 Sep 2007 11:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://marianoiglesias.com.ar/1/cakephp-1-2-tip-of-the-day-be-mindful-of-modelset/#comment-111</guid>
		<description>Well, I think if something is a common misunderstanding then it is probably the framework&#039;s fault. If I see a set method then I expect it sets the provided data, but not that it merges them with some existing data (then the method should be named &quot;add&quot; for example). So to me the set method you showed simply violates the convention for set methods.
</description>
		<content:encoded><![CDATA[<p>Well, I think if something is a common misunderstanding then it is probably the framework&#8217;s fault. If I see a set method then I expect it sets the provided data, but not that it merges them with some existing data (then the method should be named &#8220;add&#8221; for example). So to me the set method you showed simply violates the convention for set methods.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk
Database Caching 10/24 queries in 0.051 seconds using disk

Served from: marianoiglesias.com.ar @ 2010-07-30 05:14:02 -->