<?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>Agence de Développement Informatique du Nord &#187; eav</title>
	<atom:link href="http://blog.adin.pro/tag/eav/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adin.pro</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 26 Dec 2019 08:54:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Left join on addAttributeToFilter with EAV tables</title>
		<link>http://blog.adin.pro/2013-03-07/left-join-on-addattributetofilter-with-eav-tables/</link>
		<comments>http://blog.adin.pro/2013-03-07/left-join-on-addattributetofilter-with-eav-tables/#comments</comments>
		<pubDate>Thu, 07 Mar 2013 09:54:01 +0000</pubDate>
		<dc:creator><![CDATA[blogadmin]]></dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[addAttributeToFilter]]></category>
		<category><![CDATA[eav]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://blog.adin.pro/?p=126</guid>
		<description><![CDATA[<p>When you want to filter a collection with custom attribute value it works but when you want to retrieve the non-corresponding entries (like with the neq, null, not null, &#8230;. statements) it doesn&#8217;t work. Default join on collection is an &#8230; <a href="http://blog.adin.pro/2013-03-07/left-join-on-addattributetofilter-with-eav-tables/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="http://blog.adin.pro/2013-03-07/left-join-on-addattributetofilter-with-eav-tables/">Left join on addAttributeToFilter with EAV tables</a> appeared first on <a rel="nofollow" href="http://blog.adin.pro">Agence de Développement Informatique du Nord</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>When you want to filter a collection with custom attribute value it works but when you want to retrieve the non-corresponding entries (like with the neq, null, not null, &#8230;. statements) it doesn&#8217;t work.</p>
<p>Default join on collection is an inner join so if you are doing that :</p>
<pre class="brush: php; title: ; notranslate">$myCollection()-&gt;addAttributeToFilter('my_attribute', array('null' =&gt; true));</pre>
<p>.. you will find no entries</p>
<p>If you want to change the default inner join to a left join you just have to add &#8216;left&#8217; as the third parameter of the addAttributeToFilter method :</p>
<pre class="brush: php; title: ; notranslate">$myCollection()-&gt;addAttributeToFilter('my_attribute', array('null' =&gt; true), 'left');</pre>
<p>and now it works&#8230;</p>
<p>Here is the prototype of the corresponding method in <strong>Mage_Catalog_Model_Resource_Product_Collection</strong> :</p>
<pre class="brush: php; title: ; notranslate">public function addAttributeToFilter($attribute, $condition = null, $joinType = 'inner')</pre>
<p>We can see that inner parameter is used by default</p>
<p>The post <a rel="nofollow" href="http://blog.adin.pro/2013-03-07/left-join-on-addattributetofilter-with-eav-tables/">Left join on addAttributeToFilter with EAV tables</a> appeared first on <a rel="nofollow" href="http://blog.adin.pro">Agence de Développement Informatique du Nord</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adin.pro/2013-03-07/left-join-on-addattributetofilter-with-eav-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
