<?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: How to use NOT IN in a condition</title>
	<atom:link href="http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: SQL mit CakePHP und der Bedingung NOT IN - Ralf Hohoff</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-244708</link>
		<dc:creator>SQL mit CakePHP und der Bedingung NOT IN - Ralf Hohoff</dc:creator>
		<pubDate>Tue, 22 Nov 2011 14:36:22 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-244708</guid>
		<description>[...] Quelle: http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Quelle: <a href="http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/" rel="nofollow">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-177353</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 20 Oct 2010 15:51:27 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-177353</guid>
		<description>@Moe: Yep, using the array syntax is the Cake way. And in CakePHP 1.3.x the string approach will no longer work...</description>
		<content:encoded><![CDATA[<p>@Moe: Yep, using the array syntax is the Cake way. And in CakePHP 1.3.x the string approach will no longer work&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moe Sweet</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-176323</link>
		<dc:creator>Moe Sweet</dc:creator>
		<pubDate>Sat, 09 Oct 2010 18:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-176323</guid>
		<description>Second way is the CAKE WAY.
It is useful when you already have the whole long cake-conditions  and want to append the IN condition in find() and paginate() functions.</description>
		<content:encoded><![CDATA[<p>Second way is the CAKE WAY.<br />
It is useful when you already have the whole long cake-conditions  and want to append the IN condition in find() and paginate() functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-124449</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 31 Mar 2009 14:39:57 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-124449</guid>
		<description>@Luiz: Thanks for your example!</description>
		<content:encoded><![CDATA[<p>@Luiz: Thanks for your example!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luiz Lopes</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-124025</link>
		<dc:creator>Luiz Lopes</dc:creator>
		<pubDate>Thu, 26 Mar 2009 16:22:56 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-124025</guid>
		<description>This worked with what I am trying to do. I&#039;m using 
&lt;code&gt;
$this-&gt;set(&#039;agents&#039;,$this-&gt;Contract-&gt;User-&gt;find(&#039;list&#039;,array(
			&#039;fields&#039; =&gt; array(&#039;User.id&#039;,&#039;User.username&#039;),
			&#039;conditions&#039; =&gt; array(&#039;User.active =&#039; =&gt; &#039;1&#039;,
							&#039;NOT&#039; =&gt; array(
								&#039;User.username&#039; =&gt; array(&#039;admin&#039;,$this-&gt;Auth-&gt;user(&#039;username&#039;))
							))
			))
);
&lt;/code&gt;
Which produces the following:
&lt;code&gt;
SELECT `User`.`id`, `User`.`username` FROM `users` AS `User` WHERE `User`.`active` = 1 AND NOT (`User`.`username` IN (&#039;admin&#039;, &#039;user&#039;))&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This worked with what I am trying to do. I&#8217;m using<br />
<pre><code>$this-&gt;set('agents',$this-&gt;Contract-&gt;User-&gt;find('list',array(
			'fields' =&gt; array('User.id','User.username'),
			'conditions' =&gt; array('User.active =' =&gt; '1',
							'NOT' =&gt; array(
								'User.username' =&gt; array('admin',$this-&gt;Auth-&gt;user('username'))
							))
			))
);</code></pre><br />
Which produces the following:<br />
<code>SELECT `User`.`id`, `User`.`username` FROM `users` AS `User` WHERE `User`.`active` = 1 AND NOT (`User`.`username` IN ('admin', 'user'))</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-112081</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 06 Nov 2008 15:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-112081</guid>
		<description>@ohcibi: Well, the second approach mentioned in the article uses an array ;-)

Since I wrote this article the find(&#039;all&#039;) syntax has been introduced and so the modified example looks like:
&lt;pre&gt;
&lt;code&gt;
$this-&gt;User-&gt;find(&#039;all&#039;, array(&#039;conditions&#039; =&gt; array(&#039;NOT&#039; =&gt; array(&#039;User.id&#039; =&gt; array(1, 2, 4)))));
&lt;/code&gt;
&lt;/pre&gt;
Hope that helps!</description>
		<content:encoded><![CDATA[<p>@ohcibi: Well, the second approach mentioned in the article uses an array ;-)</p>
<p>Since I wrote this article the find(&#8216;all&#8217;) syntax has been introduced and so the modified example looks like:</p>
<pre>
<code>$this-&gt;User-&gt;find('all', array('conditions' =&gt; array('NOT' =&gt; array('User.id' =&gt; array(1, 2, 4)))));</code>
</pre>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ohcibi</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-111953</link>
		<dc:creator>ohcibi</dc:creator>
		<pubDate>Tue, 04 Nov 2008 17:04:53 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-111953</guid>
		<description>even if
&lt;code&gt;$this-&gt;User-&gt;findAll(array(’User.id’=&gt;’NOT IN (1, 2, 3)’);&lt;/code&gt;
would work it makes no sense at all. 

the point is, that we want to keep our 1,2,3 in an array and not transform them into text....</description>
		<content:encoded><![CDATA[<p>even if<br />
<code>$this-&gt;User-&gt;findAll(array(’User.id’=&gt;’NOT IN (1, 2, 3)’);</code><br />
would work it makes no sense at all. </p>
<p>the point is, that we want to keep our 1,2,3 in an array and not transform them into text&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-7812</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 26 Jul 2007 09:21:02 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-7812</guid>
		<description>@moeffju: I am not aware of such a tutorial...</description>
		<content:encoded><![CDATA[<p>@moeffju: I am not aware of such a tutorial&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: moeffju</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-7807</link>
		<dc:creator>moeffju</dc:creator>
		<pubDate>Wed, 25 Jul 2007 19:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-7807</guid>
		<description>Oh well, development was fine as long as everything was read-only, but actually saving data and implementing a system where users can suggest edits and a moderator can accept or deny them... that sucks. Are there any good tutorials on saving huge models with lots of related models?</description>
		<content:encoded><![CDATA[<p>Oh well, development was fine as long as everything was read-only, but actually saving data and implementing a system where users can suggest edits and a moderator can accept or deny them&#8230; that sucks. Are there any good tutorials on saving huge models with lots of related models?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/comment-page-1/#comment-6354</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sun, 29 Apr 2007 07:58:32 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/#comment-6354</guid>
		<description>@Diego: Thanks for the link!</description>
		<content:encoded><![CDATA[<p>@Diego: Thanks for the link!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

