eZContentObjectTreeNode AttributeFilter

Author Message

Ivan Švogor

Monday 07 March 2011 6:58:44 am

Any idea why doesn't work? - AttributeFilter specifcally...

include_once('kernel/classes/ezcontentobjecttreenode.php');

        
        $objects =& eZContentObjectTreeNode::subTreeByNodeID(  array(
            'ClassFilterType' => 'include',
            'ClassFilterArray' => array( 'article' ),
            'SortBy' => array( 'published', false ),
            'AttributeFilter' => array('and',array('article/title','like', '*'))
            ),
            $node_id
        );

this one works.... But this one not (relation_category) is object relation

include_once('kernel/classes/ezcontentobjecttreenode.php');

        
        $objects =& eZContentObjectTreeNode::subTreeByNodeID(  array(
            'ClassFilterType' => 'include',
            'ClassFilterArray' => array( 'article' ),
            'SortBy' => array( 'published', false ),
            'AttributeFilter' => array('and',array('article/relation_category','like', '*'))
            ),
            $node_id
        );

Marko Žmak

Monday 07 March 2011 12:47:43 pm

The code you're using for filtering on object relation attribute should work. I've just tested id on my site and it works (ezP 4.2). It returned all the articles. I used the same code as you did, just with a different class and attribute.

So it seems like there must be something else wrong with your code.

Maybe you misspelled the attribute name?

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

Hubert Farnsworth

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 02:45:43
Script start
Timing: Jan 18 2025 02:45:43
Module start 'layout'
Timing: Jan 18 2025 02:45:43
Module start 'content'
Timing: Jan 18 2025 02:45:44
Module end 'content'
Timing: Jan 18 2025 02:45:44
Script end

Main resources:

Total runtime0.8332 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.0313152.6406
Module start 'layout' 0.00620.0038 740.671939.4844
Module start 'content' 0.01000.8217 780.1563528.6328
Module end 'content' 0.83170.0014 1,308.78918.1250
Script end 0.8332  1,316.9141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4075160.0002
Check MTime0.00140.1659160.0001
Mysql Total
Database connection0.00110.130510.0011
Mysqli_queries0.788994.6860540.0146
Looping result0.00050.0606520.0000
Template Total0.798895.920.3994
Template load0.00210.256620.0011
Template processing0.796795.617820.3983
Template load and register function0.00020.026410.0002
states
state_id_array0.00080.100410.0008
state_identifier_array0.00140.168120.0007
Override
Cache load0.00170.2072120.0001
Sytem overhead
Fetch class attribute can translate value0.00060.077820.0003
Fetch class attribute name0.00160.186730.0005
XML
Image XML parsing0.00070.088420.0004
class_abstraction
Instantiating content class attribute0.00000.003830.0000
General
dbfile0.00080.0993180.0000
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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs