fetchObjectTree not sorting correctly

Author Message

Camilo Cienfuegos

Monday 25 June 2007 8:16:04 am

Hello,

I'm retrieving a tree of objects with:


$sortBy = " array('priority', true) ";

$data =& eZContentFunctionCollection::fetchObjectTree(
    144, // parentNodeId
    $sortBy,// sortBy 
    false, //onlyTranslated
    false, //language
    0, //offset
    false, //limit
    3, //depth
    false, //depthOperator 
    false, //classID
    false, //attribute_filter
    false, //extended_attribute_filter
    false, //class_filter_type
    false, //class_filter_array
    false, //groupBy
    false, //mainNodeOnly
    true, //ignoreVisibility
    true, //limitation
    true // asObject
);

The method returns data, but it is not sorting the objects by priority. Can anyone help?

Many thanks

André R.

Monday 25 June 2007 8:24:41 am

try:

$sortBy = array('priority', true);

EDIT:
Should probably also give a better example of code, I'm not sure where you got that one from.

 
    $nodeObjects =& eZContentObjectTreeNode::subTree(
        array( 'Depth' => 3,
               'Limit'            => 50,
               'Offset'           => 0,
               'SortBy'           => array('priority', true),
               'DepthOperator'    => 'lt',
               'ClassFilterType'  => 'include',
               'ClassFilterArray' => array('folder'),
               'AsObject'         => true
               ), 144 );

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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

Main resources:

Total runtime1.2258 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.0065 589.2578152.6250
Module start 'layout' 0.00650.0028 741.882839.4453
Module start 'content' 0.00941.2151 781.3281528.1563
Module end 'content' 1.22440.0014 1,309.48448.1563
Script end 1.2258  1,317.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2585160.0002
Check MTime0.00140.1120160.0001
Mysql Total
Database connection0.00070.054710.0007
Mysqli_queries1.180996.3313540.0219
Looping result0.00050.0409520.0000
Template Total1.193597.420.5967
Template load0.00240.194520.0012
Template processing1.191197.164820.5955
Template load and register function0.00020.020110.0002
states
state_id_array0.00150.123610.0015
state_identifier_array0.00090.075020.0005
Override
Cache load0.00190.1531150.0001
Sytem overhead
Fetch class attribute can translate value0.00080.069220.0004
Fetch class attribute name0.00160.127730.0005
XML
Image XML parsing0.00070.060220.0004
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00110.0879170.0001
String conversion0.00000.000640.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
4content/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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs