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.