Question reguarding attribute_filter array

Author Message

Norman Leutner

Saturday 14 January 2006 12:03:47 pm

I need a simple list of nodes which belong to the current user and don't have the boolean attribute 'beendet' = true.

As far as I understand to following template code should match my needs:

{def $projekte=fetch( 'content', 'tree',
                   hash( 'parent_node_id','2',
                         'sort_by',array( 'published', false()),
                          attribute_filter, array( array('owner', '=', $user.contentobject_id),
                                                         array('beendet', '!=', true )),
                         'class_filter_type',  'include',
                         'class_filter_array', array( 'projekt' ) ) )}

I already took a look at http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/list
but can't get it working.

                          attribute_filter, array( 'and',
                                                         array('owner', '=', $user.contentobject_id),
                                                         array('beendet', '!=', true )
                                                       ),

also doesn't return the needed nodes.

A workaround for this would be to filter by myself:

{def $projekte=fetch( 'content', 'tree',
                   hash( 'parent_node_id','2',
                         'sort_by',array( 'published', false()),
                         attribute_filter, array( array('owner', '=', $user.contentobject_id) ),
                         'class_filter_type',  'include',
                         'class_filter_array', array( 'projekt') ) )
}

{foreach $projekte as $keyVar => $projekt sequence array('bglight', 'bgwhite') as $sequenceVar}

  {if ne($projekt.object.data_map.data_int, '1'}
    {$projekt.name|wash()}<br/>
  {/if}

{/foreach}

Has anyone a better solution to filter by boolean attributes?

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Saturday 14 January 2006 12:15:22 pm

Ok, I got it.

Just a small mistake:

                          attribute_filter, array( 'and',
                                                   array('owner', '=', $user.contentobject_id),
                                                   array(projekt/beendet', '!=', '1' )),

'projekt/beendet' did the trick...

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Sunday 15 January 2006 4:47:57 am

Ok at least the final result for further users:

                     attribute_filter, array( 'and',                                                    
                                                    array('owner', '=',  $user.contentobject_id),
                                                    array(projekt/beendet', '!=', true() )
                                                  ), 

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

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 30 2025 21:44:09
Script start
Timing: Jan 30 2025 21:44:09
Module start 'layout'
Timing: Jan 30 2025 21:44:09
Module start 'content'
Timing: Jan 30 2025 21:44:09
Module end 'content'
Timing: Jan 30 2025 21:44:09
Script end

Main resources:

Total runtime0.0256 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.2656151.2266
Module start 'layout' 0.00580.0055 739.4922220.7188
Module start 'content' 0.01130.0129 960.21091,001.9609
Module end 'content' 0.02420.0014 1,962.171937.9922
Script end 0.0256  2,000.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002911.4010140.0002
Check MTime0.00114.3083140.0001
Mysql Total
Database connection0.00072.764810.0007
Mysqli_queries0.003312.905430.0011
Looping result0.00000.106110.0000
Template Total0.00103.810.0010
Template load0.00072.803910.0007
Template processing0.00031.023110.0003
Override
Cache load0.00051.943810.0005
General
dbfile0.00031.240980.0000
String conversion0.00000.039140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs