Tuesday 30 May 2006 4:26:47 am
Hi all I am using 'fetchObjectTree' function to export contents to a CSV file in my modified "CSV Extract" extension. I want to make shure that the sorting of the export is the same as the sorting of the parent folder. I use 'fetchObjectTree' like this :
$list =& eZContentFunctionCollection::fetchObjectTree($Subtree, $sortBy, false, false, $Offset, $Limit,
$Class_id, false, false, 'include', array($Class_id),
false, false, true, true, true);
My problem is to retrieve the 'sort_array' of a certain node to force the function to order the results the same as the parent node with the $sortBy variable. '$Subtree' is the node_id integer. This is the code i use to retrieve the sort_array for this node_id :
$myNode =& eZContentObjectTreeNode::fetch($Subtree, false, false);
$sortBy = eZContentObjectTreeNode::sortArrayBySortFieldAndSortOrder($myNode['sort_field'], $myNode['sort_order']);
$sortBy = $sortBy[0];
$sortBy give me the sort_array of the $Subtree node_id
It works but is there a shorter/cleaner way to do the same thing ? Why all those classes/php functions aren't documented ? Thanx for every help :p Martin
EZP is Great
|