Excluding nodes from a list fetch?

Author Message

Josh Bair

Monday 04 May 2009 7:55:20 pm

We have 2 list fetches and want to exclude nodes from the first fetch in the second fetch. The parent_node_ids are the same as well as the class_attribute_filter. Is there anyway to do this without an extended attribute filter or unnecessarily fetching the same node twice?

Ideally we would pass an array of node ids to the second fetch and these would be excluded.

Łukasz Serwatka

Monday 04 May 2009 11:30:10 pm

This is not possible I'm afraid. You have to use extended attribute filter if you want to filter on specific node ids. I don't know details behind your implementation logic, but it might be also possible to use offset and max params for foreach template function if you want to skip some first nodes in second loop. Then only one fetch could be used.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Josh Bair

Tuesday 05 May 2009 8:07:07 am

Hey Łukasz,

I was able to use the offset method in a couple tpl locations but we also have an eZ Flow zone with 2 dynamic blocks that could benefit from this. Both blocks use eZFlowLatestObjects -- same class and parent; just a different number of active results.

Bård Farstad

Tuesday 05 May 2009 8:26:22 am

What about writing a custom template function optimized for your fetch? That also enables you to tune the query for your situation and optimize for memory usage and performance.

-bård

Documentation: http://ez.no/doc

Frédéric DAVID

Tuesday 05 May 2009 8:37:59 am

for exclude nodes from list fetch, you can use path in your attribute_filter.

attribute_filter, array( array( 'path', 'not_in', array( path_string, path_string) )

I don't know for the performance of this method.

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

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 30 2025 00:52:19
Script start
Timing: Jan 30 2025 00:52:19
Module start 'layout'
Timing: Jan 30 2025 00:52:19
Module start 'content'
Timing: Jan 30 2025 00:52:19
Module end 'content'
Timing: Jan 30 2025 00:52:19
Script end

Main resources:

Total runtime0.0131 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.1328151.2109
Module start 'layout' 0.00520.0025 739.343836.6484
Module start 'content' 0.00770.0042 775.992294.1563
Module end 'content' 0.01190.0012 870.148437.9922
Script end 0.0131  908.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002418.1561140.0002
Check MTime0.00118.1386140.0001
Mysql Total
Database connection0.00107.413310.0010
Mysqli_queries0.002216.898730.0007
Looping result0.00000.085710.0000
Template Total0.00096.710.0009
Template load0.00075.235610.0007
Template processing0.00021.481610.0002
Override
Cache load0.00053.706710.0005
General
dbfile0.00075.020680.0001
String conversion0.00000.045640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs