Forums / Setup & design / Fetch and nested attribute_filter

Fetch and nested attribute_filter

Author Message

Tobias Vogel

Tuesday 29 January 2008 7:50:51 am

Hi all,

I'm in need for a possibility to use (or emulate) a nested attribute_filter using the fetch function.

Example with a simple boolean condition:

(a < 1) && ((b = 2) || (c = 3))

IMHO it's not possible to express this using an attribute-filter, as it only allows one boolean operator for all filter criterias.

I tried something like the following construct to nest the filter criterias, but it won't work either:

array('and',
    array('myclass/attribute1, '<', '1'),
    array('or',
        array('myclass/attribute2', '=', '2'),
        array('myclass/attribute3', '=', '3)
    )
)

Does anyone have another idea or is it simply not possible?

Kind regards,
Tobias

Felix Laate

Tuesday 29 January 2008 2:48:08 pm

Hi Tobias!

Have a look at the Extended attribute filter: http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list

It might be what you are looking for.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Nabil Alimi

Tuesday 15 December 2009 6:58:58 am

Hello,

I'm trying something similar at the moment and for some reason it's not working. I know I've made similar things in the past but the current version (4.2) doesn't seem to handle it.

Here's what my fetch looks like:

attribute_filter , array( 'and' , array( 'article/date_publication' , '>=' , 1261260000 ) ,
                                                                    array( 'article/titre' , 'like' , '*plat*' ) ,
                                                                    array( 'or' , array( 'article/chapo' , 'like' , '*commerciale*' ) ,
                                                                                  array( 'article/chapo' , 'like' , '*le*' )  ) )

Am I wrong ?

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr