Help with fetch please.

Author Message

Jorge estévez

Sunday 05 October 2008 7:12:01 pm

Hello,

I have 16 classes, each one of them has the attribute (line text) named "Product code" with his identifier product_code

I would like to do the following:

Fetch from node XXX depth 100 all items instances of all the 16 classes that match the criteria "product_code equals to 'text to compare'"

something like this:


{set $newchildren=fetch_alias('children', hash( 'parent_node_id', 172,
                                 depth, 100,
                                'class_filter_type', 'include',
                                'class_filter_array', $newclasses,
                                'attribute_filter',                                    
                                 array( 'or', array('modelo_de_producto/product_code' , '=', "text to compare" ))
                                 ) )}

Being <strong>$newclasses</strong> the names of all the 16 classes.

What I cannot get straight is the

array( 'or', array('modelo_de_producto/product_number' , '=', "text to compare"


As I have always to write the class name plus the attribute, here <strong>modelo_de_producto</strong> is one of the classes to search (one of the 16 classes).

How can I make the fetch for all the 16 classes instances?

Can someone help me please. I am near to my deadline with this!

thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

André R.

Sunday 05 October 2008 10:48:39 pm

Attribute filter when used on attribute only works on one class at a time.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jorge estévez

Tuesday 07 October 2008 4:34:33 am

Hello,

Thanks for your reply,

ok, made another workaround and solved the problem, thre should be something in the future that could fetch multiple classes comparing one attribute, this could be usefull indeed.

best regards, jorge

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

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 19 2025 04:22:17
Script start
Timing: Jan 19 2025 04:22:17
Module start 'layout'
Timing: Jan 19 2025 04:22:17
Module start 'content'
Timing: Jan 19 2025 04:22:18
Module end 'content'
Timing: Jan 19 2025 04:22:18
Script end

Main resources:

Total runtime1.4522 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.0087 589.1484152.6250
Module start 'layout' 0.00870.0057 741.773439.4297
Module start 'content' 0.01441.4361 781.2031537.4297
Module end 'content' 1.45060.0016 1,318.632812.1875
Script end 1.4521  1,330.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2521160.0002
Check MTime0.00150.1009160.0001
Mysql Total
Database connection0.00110.078810.0011
Mysqli_queries1.385195.3804570.0243
Looping result0.00060.0432550.0000
Template Total1.408197.020.7041
Template load0.00210.143320.0010
Template processing1.406096.823020.7030
Template load and register function0.00030.017510.0003
states
state_id_array0.00130.090910.0013
state_identifier_array0.00110.078520.0006
Override
Cache load0.00170.1193250.0001
Sytem overhead
Fetch class attribute can translate value0.00100.070820.0005
Fetch class attribute name0.00150.103940.0004
XML
Image XML parsing0.00080.055620.0004
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00210.1472170.0001
String conversion0.00000.001240.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs