Fetch only object with a selection-attribute specified?

Author Message

Daniele Nocentini

Wednesday 31 May 2006 6:49:36 am

Hi

I have a class with a three selection attributes. I want to fetch only nodes with that selection contain specific string. This would be my guess, but I'm not able to get it work:

{def $list_items=fetch( 'content', 'list', hash( 'parent_node_id', 138,
			  
              'class_filter_type',  'include',
              'class_filter_array', array(38),
			  'attribute_filter', array( 'and', array( 299, '=', 'Commerciale' ), array( 300, '=', 'Moto' ) ),
			   ) )}

Antica Bottega Digitale srl
http://www.abd.it

Marcin Drozd

Wednesday 31 May 2006 7:38:43 am

Hi Daniele
try with

{def $list_items=fetch( 'content', 'list', hash( 'parent_node_id', 138,
             'class_filter_type', 'include',
             'class_filter_array', array(38),
                         'attribute_filter', array( 'and', array( 299, '=', 'Commerciale' ), array( 300, '=', 'Moto' ) )
                          ) )}

without "," after 'Moto' ) ) :)

http://ez-publish.pl

Daniele Nocentini

Wednesday 31 May 2006 12:37:29 pm

The question is, can attribute_filter works with selection datatype (with multiple selection choice)?

Antica Bottega Digitale srl
http://www.abd.it

Marcin Drozd

Wednesday 31 May 2006 2:48:08 pm

Hi, I got it wrong, sorry

can attribute_filter works with selection datatype?

Yes, it is possible, but U should use:

'attribute_filter', array( array( 299, '=', VALUE ) )

where VALUE starts from 0.
(with selection datatype (with single choice, I never tested with multiple) options have value from 0)

ex. for

<select name="aaa">
<option value="0">Commerciale 1</option>
<option value="1">Commerciale 2</option>
<option value="2">Commerciale</option>
</select>

use:

(for string 'Commerciale') 'attribute_filter', array( array( 299, '=', 2 ) ) or better
'attribute_filter', array( array( 299, '=', ezhttp( 'aaa', 'post' ) ) )

http://ez-publish.pl

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:44:10
Script start
Timing: Jan 19 2025 04:44:10
Module start 'layout'
Timing: Jan 19 2025 04:44:10
Module start 'content'
Timing: Jan 19 2025 04:44:11
Module end 'content'
Timing: Jan 19 2025 04:44:11
Script end

Main resources:

Total runtime0.7990 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 590.8281152.6563
Module start 'layout' 0.00600.0037 743.484439.5078
Module start 'content' 0.00960.7881 782.9922551.1719
Module end 'content' 0.79770.0013 1,334.164112.1094
Script end 0.7990  1,346.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4276160.0002
Check MTime0.00140.1709160.0001
Mysql Total
Database connection0.00100.125810.0010
Mysqli_queries0.740792.7023600.0123
Looping result0.00060.0783580.0000
Template Total0.763695.620.3818
Template load0.00210.264320.0011
Template processing0.761495.292120.3807
Template load and register function0.00010.014710.0001
states
state_id_array0.00090.110110.0009
state_identifier_array0.00080.105720.0004
Override
Cache load0.00180.2199260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.093820.0004
Fetch class attribute name0.00180.219250.0004
XML
Image XML parsing0.00070.086620.0003
class_abstraction
Instantiating content class attribute0.00000.001860.0000
General
dbfile0.00080.1042160.0001
String conversion0.00000.001140.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
2content/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
6content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs