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

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 18 2025 10:40:37
Script start
Timing: Jan 18 2025 10:40:37
Module start 'layout'
Timing: Jan 18 2025 10:40:37
Module start 'content'
Timing: Jan 18 2025 10:40:37
Module end 'content'
Timing: Jan 18 2025 10:40:37
Script end

Main resources:

Total runtime0.8155 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 589.0703152.6250
Module start 'layout' 0.00820.0041 741.695339.4453
Module start 'content' 0.01230.8014 781.1406576.7813
Module end 'content' 0.81370.0017 1,357.921912.1563
Script end 0.8154  1,370.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4275160.0002
Check MTime0.00140.1740160.0001
Mysql Total
Database connection0.00110.129810.0011
Mysqli_queries0.753692.4128590.0128
Looping result0.00110.1289570.0000
Template Total0.772694.720.3863
Template load0.00280.346920.0014
Template processing0.769794.386720.3849
Template load and register function0.00040.047510.0004
states
state_id_array0.00080.101210.0008
state_identifier_array0.00060.079320.0003
Override
Cache load0.00230.2804260.0001
Sytem overhead
Fetch class attribute can translate value0.00180.219430.0006
Fetch class attribute name0.00250.309950.0005
XML
Image XML parsing0.00120.142830.0004
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00150.1796220.0001
String conversion0.00000.001540.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
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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
2content/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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs