Forums / Developer / fetchObjectTree not sorting correctly

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