Difference between list and tree

Author Message

John van der Boom

Friday 08 August 2003 5:07:30 am

I've been working with eZ for 4 months now, but I still can't see the difference between the parameters "list" and "tree" of the fetch operator.

What's the difference and when do I used the one or the other?

Paul Borgermans

Monday 11 August 2003 10:24:57 am

There isn't any difference. Both functions call the same class methods. Up to this point I don't know what the original intention was.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

John van der Boom

Monday 11 August 2003 12:49:35 pm

hehe ok :)

Tristan Koen

Wednesday 13 August 2003 11:57:55 pm

In my experience, there is a world of difference (at least on SVN2703).
'list' only returns items from the current folder.
'tree' returns items from the current folder AND all subfolders.

For example:
If you have the following structure:

Folder 1
--Article A
--Article B
--Folder 1A
----Article 1Aa
----Article 1Ab

fetch(content,list,hash(parent_node_id, <Folder 1>.node_id))}
your resultset will include the objects
Article A
Article B
Folder 1A

fetch(content,tree,hash(parent_node_id, <Folder 1>.node_id))}
your resultset will include the objects
Article A
Article B
Folder 1A
Article 1Aa
Article 1Ab

This tree recursion also applies when you in/exclude certain classes from your fetch:

For example if we exclude folders from the fetch:
fetch(content,tree,hash(parent_node_id, <Folder 1>.node_id, class_filter_type,exclude,class_filter_array,array(1))}
will return a resultset of
Article A
Article B
Article 1Aa
Article 1Ab

Regards,

Tristan

Bruce Morrison

Thursday 14 August 2003 12:53:55 am

"list" is the same as "tree" with a depth of 1. They even use the same underlying function to retrieve the content. The parameters are just more restricted with list.

It makes sense to have both.

Cheers
Bruce
designIT

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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 31 2025 00:40:01
Script start
Timing: Jan 31 2025 00:40:01
Module start 'layout'
Timing: Jan 31 2025 00:40:01
Module start 'content'
Timing: Jan 31 2025 00:40:02
Module end 'content'
Timing: Jan 31 2025 00:40:02
Script end

Main resources:

Total runtime1.3634 sec
Peak memory usage8,192.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.1563151.2109
Module start 'layout' 0.00630.0046 739.3672220.6875
Module start 'content' 0.01091.3518 960.05474,546.1484
Module end 'content' 1.36270.0007 5,506.203111.8438
Script end 1.3634  5,518.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2474160.0002
Check MTime0.00120.0892160.0001
Mysql Total
Database connection0.00100.072710.0010
Mysqli_queries1.270493.1786670.0190
Looping result0.00070.0480650.0000
Template Total1.312296.220.6561
Template load0.00210.157520.0011
Template processing1.310196.087420.6550
Template load and register function0.00130.095510.0013
states
state_id_array0.00200.145510.0020
state_identifier_array0.00160.116520.0008
Override
Cache load0.00190.1401520.0000
Sytem overhead
Fetch class attribute can translate value0.00170.122040.0004
Fetch class attribute name0.00210.155270.0003
XML
Image XML parsing0.00110.082240.0003
class_abstraction
Instantiating content class attribute0.00000.001070.0000
General
dbfile0.00160.1170230.0001
String conversion0.00000.000640.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/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: 27
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs