better attribute filtering

Author Message

Marko Žmak

Friday 01 April 2005 5:34:46 pm

Is there a possibility to combine 'and' and 'or' operators in attribute filtering?

So that I can use logical expressions like this:

condition1 and (condition2 or condition3)

I know that I can obtain this by fetching the data and filtering later, but I would like if there's a way to do this with fetch() operator.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Sunday 03 April 2005 10:28:54 pm

Hi Marko,

Yes, this is possibile. More information you can find in documentation

http://ez.no/ez_publish/documentation/reference/template_operators/logic/and
http://ez.no/ez_publish/documentation/reference/template_operators/logic/or
http://ez.no/ez_publish/documentation/reference/data_fetching/content/list

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

Marko Žmak

Monday 04 April 2005 1:35:43 pm

In the docs there are only examples how to use only one logical operator, examples like this:

array( 'and', array( 'priority', '20' ),                                        array( 'article/title', '=', 'abc' ) )

What I want to use with attribute filtering is something like this:

array('and',
      array('article/title','=','abc'),
      array('or', array('priority','=','5'),                                              
                  array('priority','=','11'),                                             
           )
     )

Since this case is not documented in the examples, and when I tried to use it it didn't work, I'd like to know if this is possible in eZ and has someone tried it? And succeseded of course :)

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Arran Price

Tuesday 05 April 2005 4:42:28 pm

Its not currently possible to use both in one statement (unfortunately).

see the second post point 2 by Frederik :
http://www.ez.no/community/forum/suggestions/suggestions_having_finished_my_first_ezpublish_project

Arran

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 20 2025 20:19:41
Script start
Timing: Jan 20 2025 20:19:41
Module start 'layout'
Timing: Jan 20 2025 20:19:41
Module start 'content'
Timing: Jan 20 2025 20:19:42
Module end 'content'
Timing: Jan 20 2025 20:19:42
Script end

Main resources:

Total runtime1.2253 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 587.9141151.2109
Module start 'layout' 0.00500.0029 739.125036.6484
Module start 'content' 0.00791.2166 775.7734623.8828
Module end 'content' 1.22440.0008 1,399.656311.8516
Script end 1.2253  1,411.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.2279160.0002
Check MTime0.00120.0995160.0001
Mysql Total
Database connection0.00100.078310.0010
Mysqli_queries1.182396.4937620.0191
Looping result0.00050.0449600.0000
Template Total1.193497.420.5967
Template load0.00160.131820.0008
Template processing1.191897.263920.5959
Template load and register function0.00010.006710.0001
states
state_id_array0.00100.083710.0010
state_identifier_array0.00100.080820.0005
Override
Cache load0.00140.1104270.0001
Sytem overhead
Fetch class attribute can translate value0.00050.042930.0002
Fetch class attribute name0.00090.074160.0002
XML
Image XML parsing0.00100.084930.0003
class_abstraction
Instantiating content class attribute0.00000.001270.0000
General
dbfile0.00080.0682260.0000
String conversion0.00000.000540.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs