Forums / Developer / fetch in php ignores AttributeFilter
Vytautas Germanavičius
Saturday 13 January 2007 3:52:43 am
I made fetch in php:
$nodes =& eZContentObjectTreeNode::subTree( array( 'Depth' => 1, 'ClassFilterType' => 'include', 'ClassFilterArray' => array('my_class' ), 'AttributeFilter', array( array( 'my_class/attr_1','=',1) ) ), 105 );
which has tu return me all nodes of class "my_class" and "attr_1" = 1 .But it returns all nodes of "my_class", even when attr_1 = 0
attr_1 is checkbox. The same problem i have in another fetch with selection...
what is wrong?
{set-block scope=root variable=cache_ttl}0{/set-block}
Kristof Coomans
Saturday 13 January 2007 4:33:01 am
There's a comma between ''AttributeFilter' and your attribute filter array, instead of a double arrow ( => ).
independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org
Monday 15 January 2007 2:24:44 am
ohhhh... so simple, i spent too much time looking to same piece of code... :) This works.
But now i have another problem - it returns too much results: if object has translation - it is displayed twice in results. also node is returned, when any of translation has attr=1.