fetch in php ignores AttributeFilter

Author Message

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

Vytautas Germanavičius

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.

{set-block scope=root variable=cache_ttl}0{/set-block}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:13:58
Script start
Timing: Jan 18 2025 22:13:58
Module start 'layout'
Timing: Jan 18 2025 22:13:58
Module start 'content'
Timing: Jan 18 2025 22:13:59
Module end 'content'
Timing: Jan 18 2025 22:13:59
Script end

Main resources:

Total runtime0.5491 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.9375152.6250
Module start 'layout' 0.00570.0031 740.562539.4453
Module start 'content' 0.00870.5390 780.0078540.8359
Module end 'content' 0.54780.0013 1,320.843812.1563
Script end 0.5491  1,333.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5990160.0002
Check MTime0.00130.2372160.0001
Mysql Total
Database connection0.00080.152610.0008
Mysqli_queries0.500091.0652570.0088
Looping result0.00060.1076550.0000
Template Total0.519194.520.2595
Template load0.00180.326720.0009
Template processing0.517394.206720.2586
Template load and register function0.00010.018810.0001
states
state_id_array0.00130.238210.0013
state_identifier_array0.00100.183820.0005
Override
Cache load0.00150.2737190.0001
Sytem overhead
Fetch class attribute can translate value0.00080.145920.0004
Fetch class attribute name0.00080.153050.0002
XML
Image XML parsing0.00080.153120.0004
class_abstraction
Instantiating content class attribute0.00000.002260.0000
General
dbfile0.00160.2935220.0001
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs